On Jan 7, 2:59 pm, shabda <[EMAIL PROTECTED]> wrote: > I want to have a models.py like this, > > class PageRevision(models.Model): > """Stores a specific revision of the page""" > text = models.TextField() > revision_for = models.ForeignKey(Page, related_name = > 'revision_for') > > class Page(models.Model): > """Stores the latest page, the page which needs to be displayed to > the user.""" > title = models.SlugField(unique = True, max_length = 100) > current_revision = models.ForeignKey(PageRevision, related_name = > 'main') > current_disc_rev = models.ForeignKey(PageRevision, related_name = > 'discussion', blank = True, null = True)
You need to place everything in the same model.py file and refer to the other class as a string: models.ForeignKey("Page"), note the quotes. Lorenzo --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---