On Oct 31, 2008, at 5:52 AM, Julien Cigar wrote:

>
> Dear SQLAlchemy users,
>
> I wondered what would you use in case of
> Let's say I have a "Content". "News" and "Event" are a "Content".
> "PlatformNews" is a "News" and "ScienceNews" is a "News" too.
>
> I use joined table inheritance, so I have a column "content_type" (the
> polymorphic_on) in my "Content" which can be "news" or "event" at the
> moment. It works well.
>
> I wondered what's the right way to do for the "PlatformNews" and the
> "ScienceNews" cases. Should I add a "content_type" column in the  
> "News"
> table ? or just another value for the "Content" content_type column ?
>
> Here are my mappers: http://pastebin.com/f337651b


the PlatformNews and ScienceNews classes would be indicated by  
additional values in the Content.content_type column.   The whole  
class hierarchy switches off the root table.   Note that the  
PlatformNews/ScienceNews classes can also use single table inheritance  
above the News table, if you wanted, or they can have their own  
distinct tables.

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

Reply via email to