I have a 3 table solution

class Organization(models.Model):
    name = models.CharField("Organization's name", max_length=100)

class OrganizationDepartment(models.Model):
    organization = models.ForeignKey(Organization)
    name         = models.CharField("Name", max_length=100)
    contacts     = models.ManyToManyField("Contact")

class Contact(models.Model):
    organization = models.ForeignKey("Organization", blank=True, null=True)
    name         = models.CharField("Contact's name", max_length=100)

I want to create a list of contacts within an organization and not in a 
given department. The problem is that it looks like I can't use the 
contact.organzationdepartment_set in an exclude. Is that correct?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/irkjf3hcKrkJ.
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.

Reply via email to