not sure what the function syntax should be. I want to select and display one record.
Here is the code so far, which invokes a compile error "invalid syntax" db.TaxonomyDetail.objectID.represent = lambda id, record:A(record.TaxonomyDetail.objectID, _target = "_blank", _href =URL(r = request, C='default/manage_object_super_type', f=select, vars = dict(id = str(ObjectSuperType.objectID))) On Sunday, July 28, 2013 4:55:53 AM UTC-7, Alex Glaros wrote: > > How do I create a hyperlink back to parent record ObjectSuperType.id from > displayed field db.TaxonomyDetail.objected below? > > The link would take user to the controller that displays parent table > ObjectSuperType. How do I pass the parms to the other controller? > > Here is the controller for the detail record. Look for field > db.TaxonomyDetail.objectID. I’d like to list its value, and also link from > it to the parent ObjectSuperType.id. > > def manage_taxonomy_detail(): > query = ((db.Taxonomy.id == db.TaxonomyData.taxonomyID) & > (db.TaxonomyDetail.taxonomyDataID==db.TaxonomyData.id)) > taxonomyList = > SQLFORM.grid(query,create=True,editable=True,deletable=True, > details=True,links_in_grid=True, > paginate=10, > fields=[db.Taxonomy.taxonomyLongName, > db.TaxonomyData.taxonomyDataName, db.TaxonomyDetail.objectID, > db.TaxonomyDetail.partyID]) > return dict(taxonomyList = taxonomyList) > > Here is the db.TaxonomyDetail table: > > db.define_table('TaxonomyDetail', ## Allows user to assign a taxonomy > field to any object > Field('objectID', 'reference ObjectSuperType'), > Field('taxonomyID','reference Taxonomy'), > Field('taxonomyDataID','reference TaxonomyData'), > Field('partyID','reference Party', label='Data Owner'), > Field('publicAccessLevel','reference PublicAccessLevelLookupTable'), > Field('taxonomyDetailComments', 'string')) ## by person entering the data > ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > db. TaxonomyDetail.objectID.requires = IS_IN_DB(db, 'ObjectSuperType.id', > '%(objectDisplayName)s',zero=T('choose one')) > db. TaxonomyDetail.objectID.represent = lambda id,row: > db.ObjectSuperType(id).objectDisplayName > db. TaxonomyDetail.taxonomyID.requires = IS_IN_DB(db, 'Taxonomy.id', > '%(taxonomyLongName)s',zero=T('choose one')) > db. TaxonomyDetail.taxonomyDataID.requires = IS_IN_DB(db, > db.TaxonomyData.id, '%(taxonomyDataName)s',zero=T('choose one')) > db. TaxonomyDetail.publicAccessLevel.requires = IS_IN_DB(db, > db.PublicAccessLevelLookupTable.publicAccessCode, > '%(publicAccessDescription)s',zero=T('choose one'), orderby= > db.PublicAccessLevelLookupTable.id) > db. TaxonomyDetail.partyID.requires = IS_IN_DB(db, db.Party.id, > '%(displayName)s',zero=T('choose one')) > db. TaxonomyDetail.partyID.represent = lambda id,row: > db.Party(id).displayName > > Here is the controller for the parent ObjectSuperType. How do I pass the > parms to it? > > def manage_object_super_type(): ## > grid = SQLFORM.smartgrid(db.ObjectSuperType), > return dict(grid=grid) > > thanks, > > Alex Glaros > -- --- 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.