I have the following situation:

-a manufacturer makes several different products (one-to-many)
-a manufacturer may have one or more production locations (one-to-many)
-each product may be made at one or more of the manufacturer's
locations and a location might produce multiple products
(many-to-many)

>From the database side, it seems to me that the following setup makes
the most sense:

class Manufacturer(models.Model):
    # ...

class MfrLocation(models.Model):
    manufacturer = models.ForeignKey(Manufacturer)
    # ...

class Product(models.Model):
    manufacturer = models.ForeignKey(Manufacturer)
    mfr_locations = models.ManyToManyField(MfrLocation)
    # ...

For the admin interface, inlines allows me to get the locations and
products on the same page as the manufacturer. This would be fine
except, from the user perspective, the product is actually primary. In
other words, they would expect to add a new product and, if info about
the manufacturer and location(s) aren't already available, to enter
that data on the same page.

So, is there a way to have the Manufacturer and MfrLocation be inline
to the Product admin page? (I tried that and get a Manufacturer has no
ForeignKey to Product error.) Or is there another way to design the
models?

Thanks!

Take care,
Don

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to