I got the error above while trying to rewrite and tidy up some code that I
had working but didn't do everything I wanted.
This is a lot neater but it doesn't work yet I think I am close!
I have a person table and a task table where task.person is type
'references person'
This is the code (not working and has never worked) so all I can say is I
know it's wrong...
def generate_inv_details():
session.inv_details = []
session.inv_total = 0
today = datetime.date.today()
query = db( (db.task.person.belongs( session.company_persons)\
& (db.task.start_time <= today )\
& (db.task.charge_to == 'COMPANY' )\
& (db.task.task_status == 'BILLABLE')))
rows=db(query).select( db.task.person,\
db.task.person.name,\
db.task.title,\
db.task.start_time,\
db.task.duration,\
db.task.task_type,\
db.task.task_status,\
db.task.charge_to,\
db.task.charge,\
db.task.payment_status )
session.inv_details=rows
for row in session.inv_details:
session.inv_total += row.task.charge
Is this totally off the wall and not even close?
Is there a problem with the format of the select statement? (which I
suspect is the issue) or
Is there a glaring problem elsewhere?
You will have to trust me when I say I have put hours of frustration and
reading into this and I only post here as a last resort!
Many thanks for your consideration!
Peter
--
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.