I want to grab the ID of parent file SharedService during a search.

What is the best way to get it?  Can it be obtained using factory or 
sqlform?

## 
-------------------------------------------------------------------------------------------------------------
## Here's the model:

db.define_table('SharedService',
Field('shortSharedServiceDescription', 'string',label='Description'),
Field('shortSharedServiceTitle', 'string', label='Title'))

db.define_table('Organization',
Field('organizationFullName','string')) ## e.g., Oracle Corporation

db.define_table('SharedServicePartnerIntersection',
Field('sharedServiceID', 'reference SharedService',
          writable=False,readable=False), 
Field('organizationID','reference Organization'))
db.SharedServicePartnerIntersection['_plural'] = 'Partner List' ## here's 
where I want to say "View or Add Partners"

## 
-------------------------------------------------------------------------------------------------------------
## Here's the controller that does the searching.  When user chooses "View 
or Add Partners", it selects this parent record.  I want to grab parent ID. 
 How?

def search_shared_services():
    grid = SQLFORM.smartgrid(db.SharedService, 
linked_tables=['SharedServicePartnerIntersection'],
    maxtextlength={'SharedServicePartnerIntersection.sharedServiceID':140, 
 
'SharedService.shortSharedServiceTitle':140,'SharedService.shortSharedServiceDescription':140})
    return dict(grid=grid)

## 
-------------------------------------------------------------------------------------------------------------

Instead of displaying "Partner List" I would like to display "View or Add 
Partners", and give user ability to view or add partners. To do this, I 
need to be able to grab the parent ID of the selected record (they select 
it by clicking on "View or Add Partners"). 

Can someone please type syntax for that?

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


Reply via email to