[web2py] Re: Pre-populated Forms

2015-12-18 Thread Val K
If your app has a create-controller (I believe it has), you can just add to it some code like this: def your_create_controller(): templ_rec_id = request.args(0) # means request like 'http://.../your_create_controller/123' 123 - id of existing record # no

[web2py] Re: Pre-populated Forms

2015-12-15 Thread Anthony Smith
Hi, Not really as new to this and working my way through it slowly, but best I keep on searching cheers Anthony On Tuesday, 15 December 2015 05:19:30 UTC+11, villas wrote: > > By 'prototype' I believe he means the record which you wish to use as a > 'template'. > > 1. Find your 'template' re

[web2py] Re: Pre-populated Forms

2015-12-14 Thread villas
By 'prototype' I believe he means the record which you wish to use as a 'template'. 1. Find your 'template' record which will be used for setting the default values of the fields in the new record. 2. Set the field.default accordingly. 3. Do not pass a record to SQLFORM. If you do, it will upd

[web2py] Re: Pre-populated Forms

2015-12-13 Thread Anthony Smith
Hi Val, Thanks for your reply, but unable to find any about get prototype record in the book. Do you have an examples Thanks Anthony On Saturday, 12 December 2015 06:03:26 UTC+11, Val K wrote: > > 1. get prototype record > 2. overwrite field.default with corresponding prototype value > 3

[web2py] Re: Pre-populated Forms

2015-12-11 Thread Val K
1. get prototype record 2. overwrite field.default with corresponding prototype value 3. don't pass record to SQLFORM On Monday, December 7, 2015 at 7:15:46 AM UTC+3, Anthony Smith wrote: > > Hi All, > > I have a products table: > db.define_table('product', > Field('product_