Hello i have this situation and need some good ideas
I have
table :auth_user ("John","Oliver","Trump")
table :dbentities ( for example Person,Equipment,Company)
each entity on entities table has subentities field of type: list:string
for example for Person , subentities=["A","B","C"]
My case is this:
Each user will be allowed to upload files based on entity/subentities
allowed to him so i need to relate the 2 tables
db.define_table(
'dbentities',
Field('entity', length=25, requires=[IS_NOT_EMPTY()]),
Field('subentities','list:string'),
format='%(entity)s',
)
db.define_table(
'userentities',
Field('auth_user', db.auth_user),
Field('entities' , "list:reference db.dbentities",requires=IS_IN_DB(db,
'dbentities.id', '%(entity)s', multiple=True),label="Entities")
)
So far so good, i think.
But i need more . i need to define for each entity associated to a user the
respective subentities allowed.
For example i create 2 records in userentities.
One for User "John" selecting only "Person" and another for "Trump"
selecting also only "Person"
However for John i want to select the subentities "A" and "C" and for Trump
the subentity "B"
of Person
This way i can control later on a form what type of subentities files they
are allowed to upload .
Can anyone help me the last mile ?
Regards
António
--
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].
For more options, visit https://groups.google.com/d/optout.