What if you've got an error for the form, in general, and that doesn't pertain to any field in particular. For instance, the new data being input conflict with data from a different table? Does it have to be form.errors.<fieldname>?
On Dec 6, 6:50 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > This should never have worked and I am surprised you did not get an > error before. form.errors has to be a storage object. Here is what it > should be: > > if form.vars.stop < form.vars.start: > form.errors.stop=T('Error: Stop is before start') > return False > return True > > On Dec 6, 4:56 pm, weheh <richard_gor...@verizon.net> wrote: > > > > > Some code that worked fine on 1.64.3 isn't working on 1.72.3, to which > > I just upgraded. I upgraded from source, so I wouldn't be surprised if > > I'm missing a file or something like that. The error message is: > > > File "C:\web2py\gluon\sqlhtml.py", line 769, in accepts > > for key in self.errors.keys(): > > AttributeError: 'lazyT' object has no attribute 'keys' > > > and is being generated by the following code which is being called as > > part of a form validator routine: > > > @auth.requires_login() > > def valid_datetimes(form): > > #------------------------------------------------------------------------------- > > """Sets form.errors if stop before start""" > > if form.vars.stop < form.vars.start: > > form.errors=T('Error: Stop is before start') > > return False > > return True > > > The test condition was that form.vars.stop < form.vars.start, > > triggering the form.errors getting assigned. > > > Anyone have any insight into what might be happening here? I searched > > the web2py group for a similar thread but came up empty handed.- Hide > > quoted text - > > - Show quoted text - -- 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.