On Sunday, May 20, 2012 11:49:41 AM UTC-4, rahulserver wrote:
>
> Thanks Anthony! 
>
> I did as u said but now i get the following error:
> <type 'exceptions.AttributeError'> 'NoneType' object has no attribute 
> 'Account'
>
> Here is the line which was found erroraneous(in pink):
>
> def viewreport():
>     form=SQLFORM.factory(Field('TID',requires=IS_IN_DB(db, 
> db.Transaction_Master.id,
>     lambda r: '%s %s %s' % (db.Account_Master[r.Account].Account, 
> r.Exam_Date, r.id))
>
>
> ))
>
> With Regards,
> rahulserver.
>

Are there records in db.Account_Master and db.Transaction_Master, and do 
all values in db.Transaction_Master.Account reference existing records in 
db.Account_Master? If not, you could add a conditional:

IS_IN_DB(db, db.Transaction_Master.id,
    lambda r: '%s %s %s' % \
    (db.Account_Master[r.Account].Account if db.Account_Master[r.Account] 
else '',
    r.Exam_Date, r.id))

Anthony

Reply via email to