In manual dont have example of createargs:

while createargs, editargs and viewargs are passed only to the specific 
> create, edit and details SQLFORMs


this is the only reference manual


Em quarta-feira, 4 de junho de 2014 00h43min27s UTC-3, Fabiano Almeida 
escreveu:
>
> Hi,
>
> How to use creatargs in SQLFORM.grid?
>
> Table:
> Objeto = db.define_table('objeto',
>       SQLField('almoxarifado_id', db.almoxarifado, notnull=True, 
> readable=True, writable=True, label='Almoxarifado'),
>       SQLField('nome', 'string', length='50', notnull=True, label='Nome'),
>       SQLField('quantidade', 'integer', notnull=True, default=0),
>       SQLField('localizacao', 'string', length='50', label='Localização'),
>       SQLField('obs', 'text', label='Especificação'))
> Objeto.almoxarifado_id.requires=IS_IN_DB(db, 'almoxarifado.id', 
> '%(nome)s')
>
> def index():
>     alm = request.args(0) or redirect(URL('almoxarifado','index'))
>     form = SQLFORM.grid(Objeto.almoxarifado_id == alm, 
> fields=[Objeto.nome, Objeto.quantidade, Objeto.localizacao], 
> createargs={'Objeto.almoxarifado_id':alm}, user_signature=False, csv=False)
>     return dict(form=form)
>
> I try create new record with field Objeto.almoxarifado_id = args(0), to 
> hide this field in form.
>
> Thanks in advance,
>
> Fabiano.
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to