Have you tried it without the showid arg? On Monday, February 10, 2014 3:12:36 AM UTC-5, Mike Constabel wrote: > > Hi, > > I try to generate multiple SOLIDFORMS from table rows. > > Simple example in pseudo code: > > x = db(y.z).select() > for d in x: > form=CAT(form, SOLIDFORM(d)) > return dict(form=form) > > > This works for me: > > Model: > > #simplified, the tables are much longer in real > > db.define_table("foo_analysis_type", > Field("uuid", length=64, default=lambda:str(uuid.uuid4())), > Field("analysis_code", "integer", label=T("analysis_code"), > requires=IS_INT_IN_RANGE(0,99999999))) > > db.define_table("foo_analysis", > Field("uuid", length=64, default=lambda:str(uuid.uuid4())), > Field("customer_uuid", length=64, label=T("customer_uuid"), > requires=IS_IN_DB(db, 'icp_customer.uuid', db.foo_customer._format, > multiple=False)), > Field("analysis_type_uuid", length=64, > label=T("analysis_type_uuid"), requires=IS_IN_DB(db, > 'foo_analysis_type.uuid', db.foo_analysis_type._format, multiple=False)), > Field("order_number", "integer", label=T("order_number"), > requires=IS_INT_IN_RANGE(0,99999999))) > > > Controller: > > fields3 = [['order_number', None]] > > form3 = P() > analysis = db(db.foo_analysis.customer_uuid == > request.get_vars.uuid).select() > for a in analysis: > form3 = CAT(form3, SOLIDFORM(db.foo_analysis, a, fields=fields3, > showid=False, readonly=True), P()) > return dict(form3=form3) > > > For every table row i got a nice form. > > But I need left outer joins. And there I stuck. > > Same Model as above, Controller: > > fields3 = [['order_number', 'analysis_code']] > > form3 = P() > analysis = db(db.foo_analysis.customer_uuid == > request.get_vars.uuid).select(db.foo_analysis.ALL, > db.foo_analysis_type.ALL, > > left=db.foo_analysis_type.on(db.foo_analysis.analysis_type_uuid==db.foo_analysis_type.uuid) > > > ) > for a in analysis: > # form3 = CAT(form3, a) < this works, it prints rows with all > data, so the select is ok? > form3 = CAT(form3, SOLIDFORM(db.foo_analysis, a, fields=fields3, > showid=True, readonly=True), P()) > return dict(form3=form3) > > Here I got > > <type 'exceptions.AttributeError'>('Row' object has no attribute 'id') > > I tried many other "combinations" of fields, forms, selects, but > got every time errors. > > > It would be really great if I can get a hint howto correct code > this. > > Regards, > Mike > >
-- 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/groups/opt_out.