I have added some stuff in trunk.

1)

reference fields now have a default IS_IN_DB validator
notull=True have a default IS_NOT_EMPTY validator
unique=True have a default IS_NOT_IN_DB validator

db.define_table('person',Field('name'), format='%(name)s')

will give all references to to a person a

    db.person.represent = lambda id: '%(name)s' % db.person[id]

so persons are always represented by a person name (in crud.read and
tables).

This is done in backward compatible way but it will change the default
look of forms and tables if you have not defined reference validators
and table.represent.

Now you can just do:

db.define_table('person',Field('name',unique=True), format='%(name)s')
db.define_table('dog',Field('name',unique=True),Field
('owner',db.person), format='%(name)s')

and everything will have default validators.

2) before you could loop over tablename and fieldname

    for tablename in db.tables
    for fieldname in table.fields

now you can loop also over fields

    for table in db
    for field in table

Please try them to make sure nothing is broken.

Massimo

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to