> db((db.task.id == 5) & (db.task.ref_to_job == db.job.id) &
> (db.job.ref_to_project == db.project.id) & (db.project.owner ==
> auth.user_id))
>
> I tried it and it works, but I am not sure how different it is from the
> one Leonel suggested. How does this work?
>
The above does a join, so i
Thanks Anthony, indeed I will have to evaluate the tradeoff of speed for
complexity. I don't think that our site will have the amount of traffic
that this would be a problem but its always good to know good practices!
A friend suggested to use
db((db.task.id == 5) & (db.task.ref_to_job == db.job
On Monday, September 8, 2014 4:47:57 AM UTC-4, Leonel Câmara wrote:
>
> Frankly, I would just store the user as the owner in all of those tables.
> Probably using auth.signature().
>
> You could do a very inefficient recursive select but I don't see any
> advantage.
>
> Something like:
>
> task =
Thank you guys for your valuable answers.
On Monday, September 8, 2014 2:51:56 PM UTC+3, Marin Pranjić wrote:
>
> Make sure to read Authorization chapter in book:
>
> http://web2py.com/books/default/chapter/29/09/access-control#Authorization
>
>
--
Resources:
- http://web2py.com
- http://web2py.
Make sure to read Authorization chapter in book:
http://web2py.com/books/default/chapter/29/09/access-control#Authorization
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (R
It's not exactly bad practice, quite the contrary, usually you want to
start with a database without redundancy. This is just a case where
denormalization really yields fruits as it is very inefficient to have to
query the jobs and projects table to know who is the owner of a task.
An alter
Thank you, so you mean is bad practice the way I implemented the tables?
When I designed it like that, I thought it would be convenient in altering
the relations between the records.
On Monday, September 8, 2014 11:47:57 AM UTC+3, Leonel Câmara wrote:
>
> Frankly, I would just store the user as
Frankly, I would just store the user as the owner in all of those tables.
Probably using auth.signature().
You could do a very inefficient recursive select but I don't see any
advantage.
Something like:
task = db.tasks[5]
if task.job.project.owner != auth.user_id: # You are doing a select fo
8 matches
Mail list logo