Oh. Might want to fix the documentation then:
http://elixir.ematia.de/apidocs/elixir.relationships.html
--------------
OneToMany
...
filter
Specify a filter criterion (as a clause element) for this
relationship. This criterion will be and_'ed with the normal join
criterion (primaryjoin) generated by Elixir for the relationship. For
example: boston_addresses =
System Message: ERROR/3 (<string>, line 190)
Unexpected indentation.
OneToMany('Address', filter=Address.city == 'Boston')
---------------
Interesting. I expected those lambdas to act like post processing,
but on further inspection they do make it into the query properly.
Thanks.
On Oct 25, 1:13 pm, Gaetan de Menten <[email protected]> wrote:
> On Sun, Oct 25, 2009 at 20:31, Nick Retallack <[email protected]> wrote:
> >>>> class Haver(Entity):
> > ... all_belongings = OneToMany('Belonger')
> > ... some_belongings = OneToMany('Belonger', filter='Belonger.stuff !
> > = None')
>
> use:
>
> some_belongings = OneToMany('Belonger', filter=lambda c: c.stuff != None)
>
> When you are stuck like this, it usually helps to look at the tests of
> Elixir, which also serve as examples. I know that more visible
> examples would be nicer, but I just don't have time for that. In your
> case, see:
>
> http://elixir.ematia.de/trac/browser/elixir/tags/0.7.0/tests/test_o2m...
>
> --
> Gaëtan de Mentenhttp://openhex.org
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---