First of all, be easy on me, I'm new to coding and new to web2py.
I am trying to get some data from the database with the following function:
def db_query(db_name, db_record, db_field, length):
query =
(db.db_name.Financial_Institution==auth.user.id)&(db.db_name.Completed==1)
db_record = db(query).select(db_field)
db_record = str(db_record[0])
ending = (len(db_record)) - 4
db_record = db_record[length:ending]
return db_record
Two problems
1. I'm having to parse the data because I need the value in the field, but
can't seem to do it with the built in helpers.
2. This particular function won't let me pass a variable into the query,
so db_name is coming across as 'db_name' and not 'the_value_I_put_in'.
Can anyone help me with this?
--
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/groups/opt_out.