For an email discussion list application I'm setting up the following
model:

Members and EmailAddress(es)
Each Member has multiple EmailAddress(es), and one PostingAddress

Definition (abbreviated):

class Member(models.Model):
    PostingAddress = models.ForeignKey(EmailAddress)   # <<<< error in
this line
    FirstName = models.CharField(blank = True, max_length = 255)
    # Snip #

class EmailAddress(models.Model):
    EmailAddress = models.EmailField()
    Member = models.ForeignKey(Member)
    # Snip #

This gives "NameError: name 'EmailAddress' is not defined". When I
swap these two classes around I get the same thing, but for the
EmailAddress.Member field

One alternative is to add a boolean field to the EmailAddress class to
say it is the posting field, i.e. change the database structure. But
is there a way to get this structure to work?

Thanks

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to