I've turned on debugging, and from what I can tell, it's not so much 
that it's occasionally coming out as NULL, so much as always going in 
as NULL - each of the INSERT INTO statements puts None into the 
discriminator field for the discriminators of all but the 
lowest-level superclasses.

Here are the relevant mapper definitions:

event_mapper = mapper(Event, event, select_table=event_join, 
polymorphic_on=event.c.discriminator, polymorphic_identity='event')

detection_mapper = mapper(Detection, detection, 
select_table=detection_join, 
polymorphic_on=detection.c.discriminator, inherits=event_mapper, 
polymorphic_identity='detection')

mapper(AspectDetection, aspect_detection, inherits=detection_mapper, 
polymorphic_identity='aspect_detection')

mapper(RFDetection, rf_detection, inherits=detection_mapper, 
polymorphic_identity='rf_detection')

-------------

event.c.discriminator is always set to None, 
detection.c.discriminator is set correctly.

Is there something I should be specifying that I'm not?

Thanks,
Chris Guin

At 12:37 PM 4/3/2008, you wrote:



>On Apr 3, 11:24 am, Chris Guin <[EMAIL PROTECTED]> wrote:
> > Actually, it turns out I'm still getting NULL in the discriminator
> > field of my base classes.  In my setup, an AspectDetection inherits
> > from Detection which inherits from Event - the discriminator field of
> > Detection is set properly, but is universally NULL in Event.  Any
> > idea why this might be the case?
> >
> >
>
>the same rules apply.  the discriminator column is physically present
>on the "event" table only, and the "event" table must be present in
>all queries for any of the subclasses.  Turning on SQL echoing
>(especially with echo='debug' to show result sets) should readily show
>why this column is coming out as NULL in some cases.
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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