Re: [web2py] Re: Querying data using admin

2016-06-09 Thread isi_jca
Ramos:

Other posibility is create a form using grid and then choose columns you 
want to show, for example:

def query_venta():
query = (db.tventa.id >= 3)  &  (db.tventa.id <= 7)

columns = [db.tventa.fecha, db.tventa.monto]]
grid=SQLFORM.grid(query,field_id = db.tventa.id,fields=columns)


query_venta.html

{{=grid}}


Regards

El jueves, 9 de junio de 2016, 12:08:39 (UTC-3), Ramos escribió:
>
> Yes it works now.
>
> Too bad that i cannot only return some of the columns. It would be perfect 
> because i have many columns and i have to scroll to the right a lot.
>
> 2016-06-09 14:55 GMT+01:00 isi_jca :
>
>> Hello!!!
>>
>> Try using Parenthesis, for example:
>>
>> (db.tventa.id >= 3)  &  (db.tventa.id <= 7)
>>
>>
>> Result Set
>> tventa.id 
>> 
>> tventa.fecha 
>> 
>> tventa.vendedor 
>> 
>> tventa.monto 
>> 
>> 3  2016-05-04 
>> Pedro 900.00
>> 4  2016-05-05 
>> Andrés 1050.00
>> 5  2016-06-08 
>> Pepe 123.31
>> 6  2016-06-09 
>> Pepe 52.36
>> 7  2016-06-10 
>> Maria 12.36
>> Regards.
>>
>>
>> El jueves, 9 de junio de 2016, 6:29:39 (UTC-3), Ramos escribió:
>>>
>>> hello 
>>> how can i, via admin query a table using in the input box more than 1 
>>> field to query?
>>>
>>> i tried
>>> db.amostras.n==203027 & db.amostras.estante1=="_E_000"  - >error
>>> db.amostras.n==203027 and db.amostras.estante1=="_E_000" -> no error but 
>>> seems to search only the second field (db.amostras.estante1=="_E_000)
>>>
>>> how can i query based on 2 fields?
>>>
>>> Regards
>>> António
>>>
>>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Re: Querying data using admin

2016-06-09 Thread António Ramos
Yes it works now.

Too bad that i cannot only return some of the columns. It would be perfect
because i have many columns and i have to scroll to the right a lot.

2016-06-09 14:55 GMT+01:00 isi_jca :

> Hello!!!
>
> Try using Parenthesis, for example:
>
> (db.tventa.id >= 3)  &  (db.tventa.id <= 7)
>
>
> Result Set
> tventa.id
> 
> tventa.fecha
> 
> tventa.vendedor
> 
> tventa.monto
> 
> 3  2016-05-04
> Pedro 900.00
> 4  2016-05-05
> Andrés 1050.00
> 5  2016-06-08
> Pepe 123.31
> 6  2016-06-09
> Pepe 52.36
> 7  2016-06-10
> Maria 12.36
> Regards.
>
>
> El jueves, 9 de junio de 2016, 6:29:39 (UTC-3), Ramos escribió:
>>
>> hello
>> how can i, via admin query a table using in the input box more than 1
>> field to query?
>>
>> i tried
>> db.amostras.n==203027 & db.amostras.estante1=="_E_000"  - >error
>> db.amostras.n==203027 and db.amostras.estante1=="_E_000" -> no error but
>> seems to search only the second field (db.amostras.estante1=="_E_000)
>>
>> how can i query based on 2 fields?
>>
>> Regards
>> António
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.


Re: [web2py] Re: Querying data using admin

2016-06-09 Thread António Ramos
Oops
Thank you Anthony

António
2016-06-09 14:39 GMT+01:00 Anthony :

> (db.amostras.n==203027) & (db.amostras.estante1=="_E_000")

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.