On Dec 16, 2008, at 1:58 PM, tobin wrote:

>
> I've ran into this and i'm not sure if this is a bug or a feature, but
> I haven't read anything about this.
>
> I had:
>
> two tables: groups and group_types, where groups had an fk to
> group_types
>
> groups: id, name, group_type_id
> group_types: id, name
>
> two mappers:
>
> group_mapper: lazy=False
> group_types_mapper: this defined 'group_type' as a backref'd attribute
> of group, lazy=False
>
> what I've noticed is that, eager loading of group_type did NOT work
> when loading a group, in this case, when I would've expected it to.
>
> however, after I moved the definition of the group_type attribute to
> the groups mapper (out of group_types_mapper), eager loading worked
> just fine.
>
> Is this a known bug or feature?

if the question is, "does backref() accept lazy=False", the answer is  
yes.   a backref() is just configuration-ese for relation(), with some  
extra flags present.   I dont know why you didn't observe eager  
loading to take place in your specific instance, you'd have to post a  
small program that illustrates and can reproduce how you got the  
behavior you're seeing.



--~--~---------~--~----~------------~-------~--~----~
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 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to