I'm having troubles with an admin portion. I am brand new at django,
so any help would be greatly appreciated. I am trying to make a class
of family members.
This works correctly when I use the admin to add new names to it. But
when I try to change an element I get this error:
TypeError at /admin/main/name/4/
Cannot resolve keyword 'name' into field
here is my class:
class Name(models.Model):
first_name = models.CharField(maxlength=40, blank=True,null=True)
middle_name = models.CharField(maxlength=40, blank=True,null=True)
last_name = models.CharField(maxlength=40, blank=True,null=True)
suffix = models.CharField(maxlength=4,choices=SUFFIX_CHOICES,
blank=True, null=True)
gender=models.CharField(maxlength=1, choices=GENDER_CHOICES,
blank=True, null=True)
birth_state = models.CharField(maxlength=30, blank=True,
null=True)
birth_country = models.CharField(maxlength=30, blank=True,
null=True)
death_state = models.CharField(maxlength=30, blank=True,
null=True)
death_country = models.CharField(maxlength=30, blank=True,
null=True)
birth_date=models.DateField(null=True,blank=True)
death_date=models.DateField(null=True,blank=True)
mother=models.ManyToManyField("self", blank=True, null=True)
father=models.ManyToManyField("self", blank=True, null=True)
sibblings=models.ManyToManyField("self" ,blank=True, null=True)
kids=models.ManyToManyField("self",blank=True, null=True)
spouse=models.ManyToManyField("self",blank=True,null=True)
class Admin:
pass
def __str__(self):
return '%s %s %s' % (self.first_name,self.last_name,
self.suffix)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---