On Wed, Apr 21, 2010 at 5:38 PM, Torsten Bronger
<bron...@physik.rwth-aachen.de> wrote:
> I think Django should store the fully qualified class name of each
> row in the parent table.  For example, the "Person" table would have
> a column with entries like "myapp.Author" or "myapp.Translator".
> Then, a find_actual_instance method could be implemented both
> reliably and efficiently.
>
> Tschö,
> Torsten.
>

This is effectively what contenttypes and generic foreign keys do. A
GFK has two parts, an item id, and a foreign key to the content type
model, which is a register of all django models, allowing you to
easily construct a Derived from a Base reference. See the end of my
reply to Tim and the docs:

http://docs.djangoproject.com/en/1.1/ref/contrib/contenttypes/#id1

The docs talk about a TaggedItem, for generating a faddish tag cloud,
but it works much better if the models you link to are actually
related and implement a common interface :)

Cheers

Tom

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

Reply via email to