Glad to hear. On Nov 20, 2012 12:34 PM, "vivek" <vi...@digambernath.org> wrote:
> No I am wrong it works! > > Thank you so much! > > > > On Tuesday, November 20, 2012 10:10:03 PM UTC+4, vivek wrote: >> >> Nope that doesn't help. >> >> >> >> On Tuesday, November 20, 2012 9:46:10 PM UTC+4, Jim S wrote: >>> >>> Try changing: >>> >>> constraints = {'db.quote':q_comm} >>> >>> to: >>> >>> constraints = {'quote':q_comm} >>> >>> Does that help? >>> >>> -Jim >>> >>> On Tuesday, November 20, 2012 9:06:15 AM UTC-6, vivek wrote: >>>> >>>> Hi , >>>> >>>> I been using SQLFORM.smartgrid and constraint successfully in many >>>> places. But for some reason my constraint for this particular grid isnt >>>> working >>>> >>>> def approval(): >>>> response.title=" Quotes waiting approval " >>>> response.view = 'Final/quotes/qapproval.html' >>>> q_comm = db.quote.status == "Approval" >>>> constraints = {'db.quote':q_comm} >>>> form = SQLFORM.smartgrid(db.quote,con**straints = >>>> constraints,linked_tables >>>> =['quoteitem'],de**letable=dict(quote=False,quote**lines=True),editable >>>> =dict(quote=True,quote**lines=True), details=dict(quote=False,quote** >>>> lines=False),create=dict(quote**=False,quotelines=True),links = dict( >>>> quote=[lambda row: A(SPAN(_class='icol-accept'),_**href=URL("quote", >>>> "convert",arg**s=[row.id]))]),csv=False) >>>> return dict(form=form) >>>> >>>> >>>> >>>> >>>> I have a common filter in my model >>>> >>>> >>>> if auth.is_logged_in(): >>>> if not auth.has_membership('admin'): >>>> db.quote._common_filter = lambda query: (db.quote.accmanager == >>>> auth >>>> .user_id) | (auth.user_id == 10) | (auth.user_id == 5) >>>> >>>> >>>> Thanking all >>>> Vivek >>>> >>>> >>>> >>>> >>>> -- > > > > --