How do you set the common filter? Seems to me if session.org is not set,
the common filter should not be set. web2py cannot ignore it because it
does the wrong thing.
On Monday, 20 August 2012 11:41:41 UTC-5, mweissen wrote:
>
> I have an application which should be used by some organizations.
> Therefore I have added
>
> Field('org','reference org', default=lambda:session.org),
>
> and
>
> common_filter = lambda query: db.my_table.org==session.org
>
> to my_table. session.org contails the id of the respective organization.
> Great feature,works fine! But using the database administration of the
> admin-application the common filter is still active.
> There is an "ignore_rw=True" in the admin application and I think I have
> read somewhere that there is also an "ignore_common_filters=True".
>
> If session.org is not set, a "database db select" shows strange effects:
>
> - I can see the first 100 rows.
> - But the message is "0 selected"
> - It is not possible to Update a record
>
>
> A simple "ignore_common_filters=True" at the appropriate location should
> solve the problem. I have taken a quick look at the code, but I think this
> statement has to be "very inside", therefore I have no concrete proposal.
>
> Regards, Martin
>
>
>
>
>
--