[web2py] Re: maybe minor bug or just documentation

2012-02-11 Thread Lewis
Thanks. I'll try those. Is there any general guidance on when an "argument" that is set with an assignment statement can be a list? ('always' would be an interesting answer...) On Feb 10, 11:24 am, Lewis wrote: > The model follows. Focus on the category.name field (and point out > anything els

[web2py] Re: maybe minor bug or just documentation

2012-02-10 Thread Anthony
> > jodb.define_table('category', > Field('name', 'string', length=100, unique = True, requires = > IS_NOT_EMPTY()), > Here, by explicitly specifying "requires", you are preventing web2py from automatically adding the IS_NOT_IN_DB validator, so you have to add that one explicitly as well.

[web2py] Re: maybe minor bug or just documentation

2012-02-10 Thread Lewis
The model follows. Focus on the category.name field (and point out anything else that looks wrong/inept). Looks like I have belt, suspenders, and back-up suspenders for that field. I need category.name to be unique and not empty. Is it the requires=IS_NOT_EMPTY() that forces me to use IS_NOT_IN_D

[web2py] Re: maybe minor bug or just documentation

2012-02-09 Thread Anthony
On Thursday, February 9, 2012 1:28:28 PM UTC-5, Lewis wrote: > > Then why did web2py fail with a run time error? Or why wasn't the run > time error trapped? Maybe because I had requires on the same table > for a different constraint? > I assume there must be an explicit "requires" attribute se

[web2py] Re: maybe minor bug or just documentation

2012-02-09 Thread Lewis
Then why did web2py fail with a run time error? Or why wasn't the run time error trapped? Maybe because I had requires on the same table for a different constraint? It doesn't look good when visitors to your site see the web2py error ticket page. Adding the explicit constraint prevented that.

[web2py] Re: maybe minor bug or just documentation

2012-02-08 Thread Anthony
> > In line 14, db.image.title represents the field "title" of table > "image". The > attribute requires allows you to set requirements/constraints that > will be > enforced by web2py forms. Here we require that the "title" is unique: > IS_NOT_IN_DB(db, db.image.title) > Notice this is option