s = datetime.date(2020,1,1)
subquery = db(db.unavailable.the_date==s)._select(db.unavailable.who) #
notice _select
db(~db.members.id.belongs(subquery)).select(db.members.ALL)
On Sunday, 15 September 2019 12:20:45 UTC-7, backseat wrote:
>
> I have a list of members that I want to schedule for certain duties. One
> table lists the people:
>
> db.define_table(
> 'members',
> Field('fullname', type='string', label='Name'),
> [...]
> )
>
> I select members from that table according to certain criteria, but I want
> to not select them if they are unavailable on a given date.
>
> I have:
>
> db.define_table(
> 'unavailable',
> Field('the_date', type='date', label='Date'),
> Field('who', type='reference members', label='Name')
> )
>
> It is possible, given a date and the other selection criteria, to get a
> list of available members for the date in question?
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/28402b3b-e99c-4779-8bc1-7b5b778897bd%40googlegroups.com.