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
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 =
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
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
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
5 matches
Mail list logo