Do you mind a bit of code review?
Why do you have a meses dictionary? The whole code for what you are doing
is completely ugly because of that single decision.
This line:
month = (list(meses.keys())[list(meses.values()).index(request.now.month - 1
)])
Could be replaced by this:
month = T(request.now.strftime("%B"))
Similarly this:
colaboradores = db(query).select(db.auth_user.first_name,db.auth_user.
last_name)
for x in colaboradores:
newlist.append(x.first_name + ' ' + x.last_name)
Could also be replaced with:
colaboradores = ['%(first_name)s %(last_name)s' % x for x in db(query).
select(db.auth_user.first_name,db.auth_user.last_name)]
This would also allow you to get rid of the newlist temporary variable and
stop using it in the view.
--
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.