Hi All,
Another long day, another silly question!
I have an Ajax component called with LOAD, which uses crud.create to
append a comment and/or image to a parent record, and so needs to hold
the reference to that record.
My table is: -
db.define_table('property_detail'
,Field('property_id',db.property
,writable=False
,readable=False
,requires = IS_IN_DB(db, 'property.id')
)
,Field('notes','text'
,comment='(visible to others if your profile is public'
)
,Field('image','upload'
,default=""
,autodelete=True
)
)
My controller is: -
@auth.requires_login()
def property_detail_insert():
crud.messages.submit_button = 'Insert Property Detail'
form=crud.create(db.property_detail
,next=URL(c='landlord', f='property_detail_index.load',
args=['property_id', request.args(1)])
,onaccept=crud.archive
)
return dict(form=form)
How do I set the value of property_id in my controller?
--
Regards,
PhilK
'a bell is a cup...until it is struck'