Yes, I know that, this is strange. My models. ---------------------------------- Table 1: Enterprise Table 2: Department with : fk_enterprise = models.ForeignKey(Enterprise) Table 3: Item with: fk_departament = models.ManyToManyField(Departament) <----THE MANYTOMANYFIELD
Many "Department"s can be associated to "Item", but every "department" associated must to be from a different "Enterprise" For example: ------------------------------- Enterprises: - A - B - C Departaments: - A1, with fk_enterprise = A - A2, with fk_enterprise = A - B1, with fk_enterprise = B - B2, with fk_enterprise = B - C1, with fk_enterprise = C Item: - XX with fk_department A1, B1, C1 <---- is OK - YY with fk_department A1, B2 <---- is OK - ZZ with fk_department A1, B1, B2, C1 <---- is WRONG because B1 and B2 have a fk_enterprise=B For now all is OK. The problem is that every user of the system is like a worker from an "Enterprise". When the user of the system are logged can only see his "Enterprise" and the "Department"s with fk_enterprise=his "Enterprise". That is the reason to need a "single select" or "input text" and not "select multiple", because the user can associate only one "Department" to an "Item", but in other "Enterprise" other user can associate other "Department" to the same "Item". To the Boss is important handle only one list of "Items". He don't want a list of "Item"s for every "Enterprise". hope I've explained better Thanks for read. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.