Let me quickly say that I'm a PHP programmer that quite recently made 
the switch to Django (and I'm VERY happy with it so far).  I've been 
working with Python for a couple years now as well.

The question I have is basically a "what would be the best way to do 
this question".  I'm setting up a database with an usual schema that 
accomplishes a specific goal.  Here is the gist of the schema.

I will have a number of "object" tables, each with their own arbitrary 
columns, but all with an auto increment PK column and "table_id" column. 
     The unusual part comes in my join table.  I want to have one 
central join table with something to the effect of the following columns:

parent_id
child_id
parent_table_id
child_table_id

The idea here is to have a central join table to allow many to many 
relationships between any and all of the "object" tables rather than 
have a zillion join tables and a rigid structure.  This allows me to add 
object tables easily down the road since that will probably be necessary.

Now, the question is, simply, what is the best way to implement this?  I 
want each "object" model to have a "parents" and "children" relation to 
the central join table.  Should I create my own Field since this is a 
variation on a ManyToManyField?  Should I just extend the 
ManyToManyField?  Or, should I just create a couple of classes, 
ParentManager and ChildManager that extend the Manager class?

I'm wondering what people with more experience would do for this situation.

If the above is not clear, please let me know where I need to clarify.

Thank you.

-- 
Jay Deiman

\033:wq!

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