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,constraints = constraints,linked_tables
> =['quoteitem'],deletable=dict(quote=False,quotelines=True), editable=dict(
> quote=True,quotelines=True), details=dict(quote=False,quotelines=False),
> create=dict(quote=False,quotelines=True),links = dict(quote=[lambda row: A
> (SPAN(_class='icol-accept'),_href=URL("quote","convert",args=[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
>
>
>
>
>
--