Since auth.signature holds the creation date of an entry to a db table, I
was hoping to use it to query for the newest 5 items and display them on
the main page.
auth=Auth(db)
auth.define_tables(username=False, signature=False)
auth.enable_record_versioning(db)
db.define_table('brandName',
Field('name'),
auth.signature,
format='%(name)s')
db.define_table('items',
Field('name'),
Field('description'),
Field('price', 'double'),
auth.signature,
format='%(name)s')
db.define_table('sale',
Field('customer', db.auth_user),
Field('item', db.items),
auth.signature)
To seed some simple test values into the database, I use the appadmin to
create a user in db.auth_user called Bob. Because the Created/Modified By
cannot be empty, I select and use Bob when adding a new brand or item.
If I want to use web2py's db.auth_user to also store customers who sign in
and do stuff, how do I separate Bob from the customer users? Bob isn't a
customer, rather he's just a user I created for the sake of entering data.
Also, is this an appropriate use of auth.signature for querying for 5
newest items (in addition to tracking changes in the database)? Or would
using a separate datetime Field for all the tables be preferred?
--
---
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.