class template_people(models.Model):
name = models.CharField(max_length=255, verbose_name=u'Имя')
lastname = models.CharField(max_length=255, verbose_name=u'Фамилия')
fathername = models.CharField(max_length=255, verbose_name=u'Отчество')
class Meta:
abstract = True
class People1(template_people):
def __unicode__(self):
return u'%s %s %s [id: %s]' % (self.lastname, self.name, self.fathername, self.id)
class Meta:
verbose_name_plural = "People1"
class People2(template_people):
def __unicode__(self):
return u'%s %s %s [id: %s]' % (self.lastname, self.name, self.fathername, self.id)
class Meta:
verbose_name_plural = "People2"
class People1Form(forms.ModelForm):
class Meta:
model = People1
class People2Form(forms.ModelForm):
class Meta:
model = People2
<form action="" method="post">
<table>
<TR><TD><br> <b>people1</b> </TD></TR>
<tr><th><label for="id_name">Имя:</label></th><td><input id="id_name" type="text" name="name" maxlength="255" /></td></tr>
<tr><th><label for="id_lastname">Фамилия:</label></th><td><input id="id_lastname" type="text" name="lastname" maxlength="255" /></td></tr>
<tr><th><label for="id_fathername">Отчество:</label></th><td><input id="id_fathername" type="text" name="fathername" maxlength="255" /></td></tr>
<TR><TD><br> <b>people2</b> </TD></TR>
<tr><th><label for="id_name">Имя:</label></th><td><input id="id_name" type="text" name="name" maxlength="255" /></td></tr>
<tr><th><label for="id_lastname">Фамилия:</label></th><td><input id="id_lastname" type="text" name="lastname" maxlength="255" /></td></tr>
<tr><th><label for="id_fathername">Отчество:</label></th><td><input id="id_fathername" type="text" name="fathername" maxlength="255" /></td></tr>
</table>
<input type="submit" value="Сохранить">
</form>
как это решить?
заранее спасибо!