The first argument to SQLFORM.grid() can be a DAL query, including a query that implies a join (which will include fields from multiple tables). To limit the fields displayed, you can use the "fields" argument (or simply set readable=False on any fields to exclude). By default, the first table encountered in the query will be the target of any create/update/delete operations. However, you can specify field_id=db.pedido.id to ensure the pedido table is the target of CRUD operations.
Anthony On Tuesday, June 26, 2018 at 7:56:18 PM UTC-4, Diego Tostes wrote: > > HI, > > I have those tables: > > > *Produto = db.define_table('produto',* > * Field('ficha_tecnica', 'upload', label=T("Ficha Tecnica")),* > * Field('descricao_produto', 'string', label=T("Descricao Produto")))* > > > *Ordem_servico = db.define_table('ordem_servico',* > * Field('identificador_os', 'string'),* > * Field('data_criacao', 'date"))* > > > *Pedido = db.define_table('pedido',* > * Field('produto_id', db.produto),* > * Field('ordem_de_servico', db.ordem_servico),* > * Field('tipo_pedido', "integer", label=T("tp")),* > * Field('tipo_producao', 'string', label=T("Tipo Producao")))* > > > > Is it possible to generate a grid using SQLFORM that show in the header: > > > *descricao_produto | identificador_os | tipo_pedido | tipo_producao * > > > And allow me to create new "pedido" ? > > Rgds > > Diego > > -- 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.