I know this can be a problem but I do consider a feature the fact that
you can define

   db.table.field.any_attribute_i_like=something

for any field. For example a student of mine has created a system for
giving semantic attributes to fields.

Massimo

On Oct 24, 3:07 am, "hamdy.a.farag" <[email protected]> wrote:
> Hi
>
> After posting this post 
> :http://groups.google.com/group/web2py/browse_thread/thread/d563b39812...
> and I'm  always finding somethings like this which causes problems
>
> here's another example
>
> import datetime
> db = DAL("mysql://root:t...@localhost/cockbook")
> db.define_table('category', Field('name'))
> db.define_table('recipe', Field('title'), Field('category',
> db.category), Field('description', length=256),
>                           Field('instructions', 'text'), Field('date',
> 'datetime', default=datetime.datetime.today()))
> db.category.name.requires = [IS_NOT_EMPTY(), IS_NOT_IN_DB(db,
> db.category.name)]
> db.recipe.title.requires = IS_NOT_EMPTY()
> db.recipe.description.requires = IS_NOT_EMPTY()
> db.recipe.category.require = IS_IN_DB(db, db.category.id, '%(title)s')
>
> see the (db.recipe.category.require)  it is not (requires)
>
> it was accepted though !!!!!! and I got mad trying to figure out why
> table recipe accepts a category that is not in the category table !!!
>
> (require) was refused though iwhen being put inside the table
> definition
>
> so why not being more strict in checking syntax ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to