On Wednesday, September 16, 2015 at 10:15:53 AM UTC-7, Leonel Câmara wrote:
>
> > I think in this case they won't be strings since I read the numbers from 
> a XML and they don't have the '+' character
>
> So what? You should future proof the app. Some day there might be 
> extensions in India or something.
>
> > Not all the supervisors.I want to get the extensions of a particular 
> supervisor
>
> Do you mean the extensions of the persons he supervises?
>

Didn't Carla say that was what she was already getting?  I understand her 
to be wanting to get either 1 or 2 extensions:  1 if the person logging in 
*is* a supervisor, and 2 if the person logging in* has* a supervisor (PLI's 
extension, + PLI's super's extension).

 

> If so:
>
> the_supervised = db(db.auth_user.Supervisor == 
> ParticularSupervisor.id)._select(db.auth_user.id)
> extensions_of_the_supervised = 
> db(db.Extension.Person.belongs(the_supervised)).select()
>
> This will give you the extensions of everyone that is supervised by this 
> person.  
>

Rough idea of what I think Carla wants:

auth.users = {("Joe", "5678", "no", "Julie"), ("Julie", "5432", "yes", "")}

stuff = db(db.auth.users.name == "Joe").select()
results = stuff.name + "has logged in at " + now() + " working at ext " + 
stuff.ext
if stuff.issuper == "no":
  morestuff = db(db.auth.users.name == stuff.supername).select()
  results = results + BR() + "Supervisor: " + morestuff.name + " at ext " + 
morestuff.ext
return results



and I think Carla is trying to do a join to get everything in 1 query.

/dps

 

-- 
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.

Reply via email to