We developed the code in the branch vue_simple_examples of the repository. In particular, please look in detail at:
See the documentation of vue.js for details on vue.
This is the code I jotted down while reviewing databases.
db.table.fieldq = (db.animal.species == 'Felix catus')q1 = (db.animal.kind == 'mammifer')q2 = (db.animal.n_paws == 4)q_12 = (q1 & q2)rows = db(q).select(db.email.id, db.email.subject)results = []for r in rows: results.append( dict(id=r['id'], subject=r.subject) )result = db(q).select().first()# This is either a row, or Noneresult = Nonefor r in db(q).select(): result = r breakresults_as_list = db(q).select().as_list()for r in results_as_list: # r.id is WRONG print r['id']db(q).select(limitby=(10, 20), orderby=~db.person.age)# This is how you delete the data.db(q).delete()r = db(q).select().first()# way 1r.age = 30r.update_record()# way 2r.update_record(age = 30)# Let's compute age in days.db(q).update(age = 365)# ---------------# URL: /default/mycontroller# Code location: default/mycontroller.pyURL('default', 'mycontroller')# URL: /default/mycontroller/3/4# Code location: default/mycontroller.pyURL('default', 'mycontroller', args=[3, 4])# Then:assert request.args[0] == 3# URL: /default/mycontroller?a=3&b=4# Code location: default/mycontroller.pyURL('default', 'mycontroller', vars=dict(a=3, b=4))assert request.vars.a == 3assert request.vars.quack == NoneURL('default', 'photos', vars=dict(page=3))pn = request.vars.page or 0db((db.photos.id > 0) & (db.photos.user_email='luca' )).select( limitby=(pn * 10, (pn + 1) * 10))