I'm trying to associate a table to a user and query for records for that user
in the table.
db = DAL("sqlite://storage.sqlite")
from gluon.tools import Authauth = Auth(db)auth.define_tables()
db.define_table('credit_card',
Field('name', notnull=True, label=T('Card Name')),
Field('interest_rate', notnull=True, label=T('Interest Rate (%)')),
# balance?
#TODO: accept commas
# I guess it is a string
Field('amount', notnull=True, label=T('Amount Owing')),
Field('minimum_payment_amount', label=T('Minimum Payment Amount')),
Field('minimum_payment_percent', label=T('Minimum Payment Percent')),
Field('annual_fee', label=T('Annual Fee')),
Field('created_by', db.auth_user, default=auth.user_id))
# How would I get a list of all credit cards for a visitorincome_list =
db.income(db.income.created_by=auth.user.id)# how would I get a sum of all the
minimum payments in a query?
--
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.