On 06/27/2012 07:30 PM, Jonathan Lundell wrote:
On Jun 27, 2012, at 4:08 AM, Pedro Casalinho wrote:
This may be a dumb question but, should forms be created in
controllers and passed to the view or should they be created in the
view, taking into consideration the MVC model
MVC is a pretty
>
> # controllers\default.py
> def index():
> return dict(authed_users=SQLTABLE(db().select(db.auth_user.ALL)))
>
> # views\default\index.html
> {{if 'authed_users' in globals():}}
> {{=T('Registered users:')}}
> {{=authed_users}}
>
This example does not show a form -- it shows a table
On Jun 27, 2012, at 4:08 AM, Pedro Casalinho wrote:
> This may be a dumb question but, should forms be created in controllers and
> passed to the view or should they be created in the view, taking into
> consideration the MVC model
>
>
MVC is a pretty leaky abstraction, especially in the conte
Create them in the controller, call them from the template (view).
Example:
# controllers\default.py
def index():
return dict(authed_users=SQLTABLE(db().select(db.auth_user.ALL)))
# views\default\index.html
{{if 'authed_users' in globals():}}
{{=T('Registered users:')}}
{{=authed_users}}
{{e
This may be a dumb question but, should forms be created in controllers and
passed to the view or should they be created in the view, taking into
consideration the MVC model
--
5 matches
Mail list logo