[web2py] Re: Multiple dicts for querying multiple tables

2018-03-20 Thread Anthony
You are returning an empty dict - you need to add those three items to it.

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


[web2py] Re: Multiple dicts for querying multiple tables

2018-03-20 Thread En Ware
Anthony, 
   
   I'm probably doing something wrong with the view then, 

I get an error if I try to call the dict in a view. 

{{extend 'layout.html'}}

Watch and Defend 



 Links:
http://localhost:8081/Hunter/default/foxtel_search;>Show 
Foxtel Records  {{=get_foxtel_count}}


http://localhost:8081/Hunter/default/lgi_search;>Show LGI 
Records{{=get_lgi_count}}

http://localhost:8081/Hunter/default/adobe_search;>Show 
Adobe Records{{=get_adobe_count}}



1.
2.
3.
4.
5.
6.

Traceback (most recent call last):
  File "/Users/aaronm/.env/python/web2py/web2py/gluon/restricted.py", line 219, 
in restricted
exec(ccode, environment)
  File 
"/Users/aaronm/.env/python/web2py/web2py/applications/Hunter/views/default/index.html",
 line 116, in 
NameError: name 'get_lgi_count' is not defined





On Tuesday, March 20, 2018 at 9:19:08 AM UTC-5, Anthony wrote:
>
> A dict can have multiple keys, so feel free to return a dict that includes 
> all three results. Of course, you can also put all three values into a 
> single object (e.g., a dict, list, or tuple), and then just return that 
> single object to the view.
>
> Anthony
>
> On Tuesday, March 20, 2018 at 9:59:21 AM UTC-4, En Ware wrote:
>>
>> Hello, 
>>
>> Trying to get the full count on three different tables. Below is a 
>> sample code. I am only able to call one count at a time. Is it possible to 
>> query all three of these and show them in a view?  
>>
>> def index():
>> get_foxtel_count=db(db.foxtel_hunter.id > 0).count()
>> get_lgi_count=db(db.lgi_hunter.id > 0).count()
>> get_adobe_count=db(db.adobe_hunter.id > 0).count()
>> #return dict(get_foxtel_count=get_foxtel_count)
>> #return dict(get_lgi_count=get_lgi_count)
>> #return dict(get_adobe_count=get_adobe_count)
>>
>> return dict()
>>
>>
>>

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


[web2py] Re: Multiple dicts for querying multiple tables

2018-03-20 Thread Anthony
A dict can have multiple keys, so feel free to return a dict that includes 
all three results. Of course, you can also put all three values into a 
single object (e.g., a dict, list, or tuple), and then just return that 
single object to the view.

Anthony

On Tuesday, March 20, 2018 at 9:59:21 AM UTC-4, En Ware wrote:
>
> Hello, 
>
> Trying to get the full count on three different tables. Below is a 
> sample code. I am only able to call one count at a time. Is it possible to 
> query all three of these and show them in a view?  
>
> def index():
> get_foxtel_count=db(db.foxtel_hunter.id > 0).count()
> get_lgi_count=db(db.lgi_hunter.id > 0).count()
> get_adobe_count=db(db.adobe_hunter.id > 0).count()
> #return dict(get_foxtel_count=get_foxtel_count)
> #return dict(get_lgi_count=get_lgi_count)
> #return dict(get_adobe_count=get_adobe_count)
>
> return dict()
>
>
>

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