[web2py] Re: table.format cannot be set after define_table()?

2011-10-30 Thread Anthony
I'd like to do this (or something like that), after all define_table()'s automatically generated by wwwsqldesigner: db.my_table.format = '%(name)s' I saw it is impossible because _format is stored as a tuple initialized with None if it's not passed to define_table(). _format defaults to

[web2py] Re: table.format cannot be set after define_table()?

2011-10-30 Thread Anthony
On Sunday, October 30, 2011 1:44:47 AM UTC-4, viniciusban wrote: In the book there's this comments about it: [cite] Most attributes of fields and tables can be modified after they are defined: db.define_table('person',Field('name',default=''),format='%(name)s') db.person._format =

Re: [web2py] Re: table.format cannot be set after define_table()?

2011-10-30 Thread Vinicius Assef
Thank you. It worked. :-) I think it would be nice to update book to document it, right? On Sun, Oct 30, 2011 at 4:24 AM, Anthony abasta...@gmail.com wrote: On Sunday, October 30, 2011 1:44:47 AM UTC-4, viniciusban wrote: In the book there's this comments about it: [cite] Most

Re: [web2py] Re: table.format cannot be set after define_table()?

2011-10-30 Thread Anthony
Now that I think about it, this has already been fixed in trunk. In trunk, you should be able to do: db.person._format='whatever' without having to first delete _format. That will work for any table attribute starting with an underscore, including the new _singular and _plural attributes

[web2py] Re: table.format cannot be set after define_table()?

2011-10-29 Thread Vinicius Assef
In the book there's this comments about it: [cite] Most attributes of fields and tables can be modified after they are defined: db.define_table('person',Field('name',default=''),format='%(name)s') db.person._format = '%(name)s/%(id)s' db.person.name.default = 'anonymous' (notice that attributes