Why not return two vars in one controller?

Instead of two controllers with one return, you can return two vars in
one controller:

return (project1 = project1, project2 = project2)

2016-02-21 17:39 GMT-04:30 Ron Chatterjee <achatterjee...@gmail.com>:
> Any other way to do this without using LOAD?
>
> I have two controller using the same view pretty much idential html:
>
> def show_project():
>     projects = []
>     projects = db().select(db.Project.ALL, orderby = db.Project.created_on,
> limitby=(0,100))
>     return dict(projects = projects)
>
> def projects_by_clicks()::
>         projects = db(db.Project.Terms.contains(project_term)).select()
>     return dict(projects = projects)
>
> How to use the same view for multiple controller?
>
> On Wednesday, January 12, 2011 at 8:23:10 AM UTC-5, Mirek Zvolský wrote:
>>
>> > I am wondering whether it is possible to show multiple controller's
>> > views...
>>
>> Inside the controller code you can change to other view:
>> if something:
>>     response.view='xxx.html'
>>
>> In the view itself you can have more named parts.
>> In such case the extended layout has not only one {{include}} command,
>> but more {{include xxx}} commands /I don't remember the syntax
>> exactly/.
>> Inside such partial views you can control use of that html part by
>> {{if something:}} Output html here {{pass}}
>
> --
> 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.

Reply via email to