Tim Chase wrote:
>> 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.
> 
> It's uncommon to do this with a many-to-many relation like your 
> join table would produce.  However, it's common enough to include 
> a "generic relation" that Django hands a generic one-to-many to 
> you on a platter via the content-types framework:
> 
> http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/
> http://www.djangoproject.com/documentation/models/generic_relations/
> 
> In theory, one could just have one join table object and then 
> have 2 generic-relations:
> 
>    from django.db.models import Model
>    from django.contrib.contenttypes import generic
>    class Foo(Model):
>        a = generic.GenericForeignKey()
>        b = generic.GenericForeignKey()
> 
> 
> I haven't explored content-types lately (like since early 0.96), 
> but I remember there being some small problem early on with a 
> little fragility in content-types -- something do with 
> model-renaming or fixture dump/reload (perhaps in the context of 
> switching databases?).  I'd have to dig through the code and Trac 
> cases to see if those have been resolved...most likely they have.

The example of the "Comparison" Model in the second link is, at first 
glance, *exactly* what I am looking to do.  I think I'm going to dig in 
tomorrow and experiment with this configuration, but it looks like this 
will be perfect for my needs.

Thanks for the help,

Jay

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