Assuming there is a field called SiteNews in the form, you could do
something like:
Field('region', 'reference region', requires=IS_IN_DB(...) if notrequest
.vars.SiteNews else None)
Anthony
On Wednesday, February 13, 2013 10:48:25 AM UTC-5, BlueShadow wrote:
>
> Hi,
> I got a table for my news articles which are normally linked to a table
> which specifies the region/country where my news comes from.
> I said that this region needs to be in the region table (IS_IN_DB)
> Now I need also news like news for my site where there should not be a
> region specified. But in all other cases it should be.
>
> So my Idea was to add a bolean Field called SiteNews.
> Is it possible to have a validator which asks if a field is true or false
> and decides whether a field needs to be empty or in the DB?
>
> thanks for your help
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.