On Thursday 10 June 2010 5:46:00 am Diez B. Roggisch wrote:
> I think the solution is to have commentable and taggable not derive from
> entity. Thus subclassing from them simply leads to add those relations.
Interesting idea, I tried this:

  class Commentable(object):
       comments = OneToMany('Comment')

but I got "Exception: Couldn't resolve target 'Commentable' in 'Comment'"

> However, this of course introduces one n:m table for each taggable or
> commentable, or one key column for each commentable on the comments table.
> 
> The only way out of this would be to have on base class, "Thing", that is
> taggable & commentable & serves as base for all those entities.
That could work, but it wouldn't scale well if I add additional "capabilities" 
(besides tagging and commenting) in the future. But I guess I can wait to 
figure that problem out until it actually arises.

Thanks for the help.

:) David

-- 
You received this message because you are subscribed to the Google Groups 
"SQLElixir" 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/sqlelixir?hl=en.

Reply via email to