OK, this is interesting: I didn't mention that I also has
limit_choices_to set on the self-referential foreign key. When I
remove limit_choices_to the problem goes away! My model is listed
below. I had set limit_choices_to=PARENT_CHOICES on OrgUnit.parent.
[start code]
LIBRARY_ID = 1
SAP_ORG_UNITS = (string, string, ...)
class OrgUnit(models.Model):
DEFAULT_HEAD_TITLE = 'Head' # Default value for OrgUnit head_title
property
# Library `departments' are children of `administrative units',
which are
# children of the top-level org unit.
PARENT_CHOICES = models.Q(is_admin_unit=True) |
models.Q(id=LIBRARY_ID)
SAPORGUNIT_CHOICES = ((s, s) for s in SAP_ORG_UNITS)
name = models.CharField(max_length=255, unique=True)
description = models.CharField(max_length=255, blank=True,
null=True)
sap_org_unit = models.CharField(max_length=20, blank=True,
null=True,
choices=SAPORGUNIT_CHOICES)
parent = models.ForeignKey('self', null=True,
blank=True,
related_name='children')
head = models.ForeignKey(Person, blank=True,
null=True,
related_name='head_of')
head_title = models.CharField(max_length=255,
default=DEFAULT_HEAD_TITLE, blank=True)
members = models.ManyToManyField(Person, null=True,
blank=True,
related_name='member_of')
is_admin_unit= models.BooleanField(default=False, null=True,
editable=False)
# Contact Info
campus_box = models.CharField(max_length=255, blank=True,
null=True)
physical_address = models.CharField(max_length=255, blank=True,
null=True)
email= models.EmailField(blank=True, null=True)
fax = models.CharField(max_length=40, blank=True,
null=True)
phone= models.CharField(max_length=40, blank=True,
null=True)
phone2 = models.CharField(max_length=40, blank=True,
null=True)
url = models.URLField(blank=True, null=True)
[end code]
Hope that help ...
Thanks,
David
> This is going to be infinitely easier to debug if have a small example
> model that reliably demonstrates the problem. At the moment, the single
> traceback is not really enough information to go on.
>
> Regards,
> Malcolm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---