[web2py] record representation and lambda

2015-11-14 Thread Anthony Smith
Hi All, I have looking though the group for and answer on this, I am try to get the product_name and batch_no from the product table to be the product in the stock task table. But getting the following traceback: Traceback (most recent call last): File "/home/tony/web2py/gluon/restricted.py

[web2py] Record representation : multiple levels of references

2014-05-23 Thread Louis Amon
Say I have a table like this: db.define_table('person', Field('first_name'), Field('last_name'), format='%(first_name)s %(last_name)s' Now if I build a new table: db.define_table('key', Field('person_id', 'reference person', requires=IS_IN_DB(db, db.person, label=db.person._format))) My new t

[web2py] Record representation and virtual fields

2014-04-09 Thread Louis Amon
I defined 2 tables as follows: db.define_table('offer', Field.Virtual('title', title_func) > db.define_table('discussion', Field('offer_id', reference offer) With title_func() a function that builds a string based on other fields in the 'offer' table. db.offer.format = '%(title)s Now when I

[web2py] Record Representation

2013-07-02 Thread greenpoise
I just implemented record representation such as the table below. My question is, is record representation supposed to save the value in the database? I am trying to create a price override field in my product table because the price can be changed within the series of a product (on the series

[web2py] Record representation and SQLFORM.grid searchable

2013-03-31 Thread Vladimir Kaznacheev
in *db.py* db.define_table('mountains', Field('m_id','integer', required=True), Field('pos','integer'), Field('x','integer'), Field('y','integer'), format='(%(x)s %(y)s)', ) db.define_table('dungeons', Field('d_id','integer', required=True), Field('mountain', 'referenc

[web2py] record representation format that refer to another table and that table is refer to another table

2013-03-21 Thread 黄祥
hi, did anyone know how to show record representation format that refer to another table and that table is refer to another table? e.g. *db.py* db.define_table('branch', Field('address', 'text'), Field('zip'), Field('city'), Field('country'), Field('phone'), Field('fax'),

Re: [web2py] record representation using a non-id column?

2011-07-20 Thread Johann Spies
On 20 July 2011 14:09, Johann Spies wrote: > > I use this: > > > db.define_table('akb_doccenter_location', > > Field('location')) > > Apologies, I did not complete the message before sending: the model includes a Field(uuid), obviously. Regards Johann -- May grace and peace

Re: [web2py] record representation using a non-id column?

2011-07-20 Thread Johann Spies
On 9 July 2011 03:47, niknok wrote: > ** > I have another unique column in my table that I would like to use as index > for record representation. How do I tell web2py to use another index? > > Ttrying to use like: > db.mytable.thisfield.represent = lambda id: db.other(myidx).thatfield > I

[web2py] record representation using a non-id column?

2011-07-08 Thread niknok
I have another unique column in my table that I would like to use as index for record representation. How do I tell web2py to use another index? Ttrying to use like: db.mytable.thisfield.represent = lambda id: db.other(myidx).thatfield