Answer the question
In order to leave comments, you need to log in
How to split a model into several blocks in the admin panel?
there is models.py (example)
class PersonSex(models.Model):
sex = models.CharField(max_length=10)
def __str__(self):
return self.sex
class FamilyStatus(models.Model):
family = models.CharField(max_length=20)
def __str__(self):
return self.family
class Seeker(models.Model):
user = models.ForeignKey(User)
# Person Info
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
birth_date = models.DateField(null=True, blank=True)
# Common Person Info
sex = models.ForeignKey(PersonSex, null=True, blank=True)
family_status = models.ForeignKey(FamilyStatus, null=True, blank=True)
class Meta:
app_label = 'some new app'
Answer the question
In order to leave comments, you need to log in
In the old days, a tuple of two values was enough for the sex field!
Maybe django-modeladmin-reorder will help you .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question