How to utilize extended query interface

3 views
Skip to first unread message

dakila

unread,
Sep 20, 2010, 8:50:11 PM9/20/10
to rum-discuss
Hi All,

Just wondering how can I utilize the extended query interface based on
the discussion below

http://groups.google.com/group/rum-discuss/browse_thread/thread/537f742054087825


Regards,
Dakila

Michael Brickenstein

unread,
Sep 21, 2010, 10:02:53 AM9/21/10
to rum-discuss
Hi!

An official interface has still to be established.
You might want to use my tiny personal utility.

from tw.rum.querybuilder import query_fields
def extend_query_fields(resource_arg, fields_arg):
@query_fields.around("issubclass(resource, resource_arg)")
def _extend_query_fields(next_method, resource):
return next_method(resource)+ fields_arg

Using that it's easy.

extend_query_fields(Address, [
"person.id", "person.firstname", ...
])

I hope that it will work for you.
Actually for me (that means my users)
queries would be far too much limited without that feature.

Cheers,
Michael

On Sep 21, 2:50 am, dakila <dak...@gmail.com> wrote:
> Hi All,
>
> Just wondering how can I utilize the extended query interface based on
> the discussion below
>
> http://groups.google.com/group/rum-discuss/browse_thread/thread/537f7...
>
> Regards,
> Dakila

dakila

unread,
Sep 24, 2010, 12:09:04 PM9/24/10
to rum-discuss
Hi Michael,

I was able to try it and works! Thanks a lot!

Regards,
Dakila
Reply all
Reply to author
Forward
0 new messages