Hi Anthony, I discovered the problem with the 200 code. It was a basically a cut and paste error. The code I was using had a try-except block wrapping the body of the POST handler method, which looks like: try: ... except Exception as e: return str(e)
I removed the exception and things behave as expected. Sorry for the wasted bandwidth. Thanks for the help, Chris On Monday, September 9, 2013 4:12:13 PM UTC-5, Anthony wrote: > > On Monday, September 9, 2013 4:40:43 PM UTC-4, Christopher Morlier wrote: > >> Okay, that is what I what I was anticipating when I asked, "Do the >> validators not check required fields?" >> >> The behavior is still a little surprising to me, since >> validate_and_insert() is part of the DAL, and it has an explicit method of >> reporting errors. >> > > The "validators" are the things you put in the "requires" attribute of a > field, typically for use with forms. The .validate_and_insert() method was > added to enable manual (i.e., non-form) inserts that still run the > validators. The "required" attribute is not a validator in this sense -- it > is enforced directly by the DAL on any insert. The intention of > .validate_and_insert() is to behave as form validation would -- that is why > it doesn't do anything special with the "required" attribute. The > "required" attribute is still processed as usual, but by the .insert() > method that gets called by .validate_and_insert(). If your goal is to use > validators to require values, simply use the IS_NOT_EMPTY() validator. > > >> It is also surprising to me that an error returns a 200 code on an >> error, but maybe that is just a problem for my use case. >> > > That does seem odd -- can you show the full code and how you are making > the call? > > Anthony > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.