On Feb 4, 12:54 pm, Gaetan de Menten <[email protected]> wrote:
> On Tue, Feb 3, 2009 at 21:27, Tvrtko <[email protected]> wrote:
>
> > There is a "bug" in EntityDescriptor.setup_table in a section of code
> > which is adding column if polymorphic option is used. In my oppinion,
> > column shouldn't be added if it is already present. This way I can
> > manually create column and still use polymorphic.
>
> It's a sane suggestion and I would like to honor it, but this could
> lead to a potentially confusing behavior if people add a column named
> "row_type", it's silently accepted, but then it's used behind their
> back as the polymorphic column.
>
> There ought to be a way for the user to tell "I know what I'm doing",
> and an option only for that seems way overkill.

Well, this covers it nicely:

1. If users says polymorphic=True, then it behaves like now: raises an
exception when there is a "row_type" column present. This prevents
unexpected behaviour.

2. But, if user says polymorphic="anything", than the user knows what
column he wants to use for polymorphic column, and if he created such
column in advance he knows what it will be used for. If there is no
such
column, we can add it - just like now.

Tvrtko

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