Hi All!

Finally I ended up with ugly solution, namely sqlhtml.py customization 
(redefinition of rows), where rows to show in grid are defined based on 
query object.

Thank you for your help and kind egards,
Marcin Jaworski


 

W dniu poniedziałek, 8 kwietnia 2013 10:12:24 UTC+2 użytkownik Marcin 
Jaworski napisał:
>
> Hi,
>
> Thank you for quick reply. 
> I have used the patch to retrieve the rows I needed (for target query 
> object). 
>
> Let's say I have retrieved list of 90 rows identified by id numbers 
> [n,n+1,...n90]. 
>
> My first idea was to combine the results of subsequent 'belongs' queries 
> to build target query object.
>
> target_query_object = db.field.id.belongs(list_of_ids[n1:n30]) 
> Magic_Operator db.field.id.belongs(list_of_ids[n31:n60]) Magic_Operator 
> db.field.id.belongs(list_of_ids[n61:n90])
>
> Unfortunately, I missed the magic operator to join sub queries (the 'and' 
> and 'or' are not giving me what I want of course) . 
> The problem is that query object (and subqueries in my case) does not 
> return the final result I can use with available logical operators (if I 
> understand it correctly), the query 'waits' to operate on database, it is 
> some kind of prepared statements, this is why my trial failed.
>
> The real solution I am seeking is how to select not None rows from grid. I 
> have taken round trip retrieving None rows (using =='' operator) and 
> substracting it (using sets operations) from all rows. This is where i am 
> so far (operators: " !='' " and " is not None " and " > None " are not 
> supported in queries). 
>
> Can you advise?
> Marcin Jaworski
>
>
> W dniu poniedziałek, 8 kwietnia 2013 04:34:57 UTC+2 użytkownik Christian 
> Foster Howes napisał:
>>
>> speaking without reading the docs.....so i might be misguided.....
>>
>> assuming that you can setup a grid with a rows object, you can use that 
>> patch.  just & the rows together and magic will happen.
>>
>> the key no matter what is to setup multiple queries on GAE and & the 
>> results together, or re-imagine the dataset so there is less than 30 items 
>> in the belongs (which is sometimes impossible).
>>
>> good luck!
>>
>> cfh
>>
>> On Sunday, April 7, 2013 2:13:35 PM UTC-7, Marcin Jaworski wrote:
>>>
>>> Hi web2py users!
>>>
>>> My environment: GAE SDK 1.7.5, web2py version 2.0.9.
>>>
>>> I need a query object as an argument for grid.
>>> I've got a database rows (ids) as the potential base for query 
>>> (list_of_ids) - unfortunately there are more than 30 of them so the 
>>> construct with 'belongs' does not work on GAE:
>>>
>>> query = db.field.id.belongs(list_of_ids)   # does not work on GAE
>>>
>>> There is a great solution to overcome the limit of 'belongs' on GAE:
>>> https://code.google.com/p/web2py/issues/detail?id=160
>>> but it let me identify just rows, when the query object for grid is 
>>> needed in my case.
>>>
>>> Can you advise?
>>> Marcin Jaworski
>>>
>>>
>>>
>>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to