On Apr 6, 2007, at 5:39 AM, svilen wrote:

>
>> seems this is the month of the many2many relations ;-)
> more on the theme: many2many
>
> i have a association of 3 tables, A,B,C.
> one of them (C) may not be present in all assoc_items.
> So that column has nullable=True.
>
> The problem is: adding associations to A-objects and saving them
> works; but retrieving omits those records which do not have 3rd item.
>
> The generated sql query is ok, executing it manualy gives proper
> results.
>
> is there some additional logic/filtering in the relation (in
> Instrumentedlist/loader) that does this, or am i missing something,
> or this is bug (and u want a testcase) ?

when you say, "association of 3 tables, A,B, C", do you mean, there  
is a table "D" that contains a reference to all of A, B, C ?

if thats the case, and D's reference columns to A, B, and C comprise  
a primary key, SA's default behavior when it sees a composite primary  
key of "3, 4, NULL" is to determine that the row does not represent  
an entity.  use the flag "allow_null_pks=True" on your mapper() to  
have such a primary key be counted. 

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