About this

IS_IN_DB(db(db.Organization.organizationPrimaryTypeID == 1),
 'Organization.id'), '%(represent_field_name)s')

I avoid using ID generally even if it does one more query I think code get
more readable in the future if you nest another query (2 ways of doing it) :

organization_id = db(db.foreign_table_name.filter_field_name ==
'something).select(db.foreign_table_name.filter_field_name).first().id
IS_IN_DB(db(db.Organization.organizationPrimaryTypeID == organization_id),
 'Organization.id'), '%(represent_field_name)s')

# OR

IS_IN_DB(db(db.Organization.organizationPrimaryTypeID ==
                         db(db.foreign_table_name.filter_field_name ==
'something

).select(db.foreign_table_name.filter_field_name).first().id),
         'Organization.id'), '%(represent_field_name)s')


Richard

On Thu, Sep 17, 2015 at 4:34 PM, Alex Glaros <alexgla...@gmail.com> wrote:

> Thanks Leonel and Anthony,
>
> works great.
>
> is used in many places and has greatly improved my app.
>
> much appreciated,
>
> Alex
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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 web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to