On May 15 2008, 6:27 pm, Michael Bayer <mike...@zzzcomputing.com>
wrote:
> On May 15, 2008, at 12:12 PM, J. Cliff Dyer wrote:
> > How can I use this field for polymorphism?  Is it possible?
>
> polymorphicdiscriminators are currently table-local scalar columns.  
> So if you had a many-to-one of discriminators, youd currently have to  
> encode the discriminator to the primarykeyidentifier of each  
> discriminotor.  We will eventually allow a python function to be used  
> as a discriminator as well which you can use to add a level of  
> abstraction to this (you'd preload the list of discriminiator objects  
> and again map based on primarykey).

Hello!

Two years later.. :P Are we going to get a python function to be used
as a discriminator soon? I would think that it would not be very
difficult to implement, right? As shown in my previous emails in the
thread "Model factory", that would solve my problem. I have the python
function already written, but I don't know how to make sqlalchemy call
to it. I thought that using a composite field should work, but it
doesn't because as you say, it's not a table-local scalar column. If
the problem is the proxy_set is not set, maybe I can set the proxy_set
var to the composite_field somehow?

Regards,
   Eduardo Robles Elvira.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to