On 6/28/06, spako <[EMAIL PROTECTED]> wrote:
> is there a way to achieve this? or should i not bother and just do have
> a Comment Model and just have VideoComment and UserComment have a
> OneToOneField to Comment?

Generally when you want to do something like this you define only one
model, and accomplish the relation to multiple classes by giving it
two fields: one a foreign key to a content-type, the other an object
id. The combination of content-type and object id specifies the exact
object it's tied to, and is generic enough to allow you to tie to any
model in your system (this is exactly how Django's built-in comments
system works).

This has recently been formalized as a "generic foreign key field",
which is being fleshed out.

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to