This works for me David,
class Staff(models.Model):
name = models.CharField(maxlength=50)
reportsTo = models.ForeignKey("self", blank=True, null=True)
def __repr__(self):
return "%s" % self.name
class Admin:
list_display = ('name',)
This is with the
Strange, since for me a similar case works in the current
magic-removal. And your DB is up-to-date with the Django model?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
I'm trying to model an employee database, with the reporting relationship modeled as (using magic-removal):class Person(models.Model): ... reports_to = models.ForeignKey("self", blank=True, null=True)
I need the blank=True because I'd like to avoid the bootstrapping problem in the admin UI
3 matches
Mail list logo