Hi mr.freeze, thanks for this. Problem solved.
Waiting for the next binary release to include this change
FG

On Mar 8, 1:56 am, "mr.freeze" <nat...@freezable.com> wrote:
> It looks like line 1099 of sqlhtml.py should be:
>  if isinstance(r,str):
> Instead of:
>  if not isinstance(r,str):
>
> It was changed on 2/10 for some reason.
>
> On Mar 7, 8:22 am, fgpy <franck...@gmail.com> wrote:> Hi,
>
> > I want to be able to display a list of records containing a date field
> > with a simplified representation of the date like 'MM/DD' instead of
> > 'yyyy-mm-dd'.
>
> > It was working fine in 1.72.3, but I get the following error after an
> > upgrade to 1.76.1:
>
> >     table = SQLTABLE(rows, linkto=mylink, headers=common.headers)
> >   File "C:\web2py\gluon\sqlhtml.py", line 1104, in __init__
> >   File "C:\web2py\gluon\sql.py", line 2676, in formatter
> >   File "C:\web2py_1.76.1\gluon\validators.py", line 2237, in formatter
> >     return self.other.formatter(value)
> >   File "C:\web2py_1.76.1\gluon\validators.py", line 1969, in formatter
> >     y = '%.4i' % value.year
> > AttributeError: 'str' object has no attribute 'year'
>
> > I tried to reproduce this error in a clean environment created with
> > 1.76.1 and I get the same error.
> > Here is the code I use:
>
> > Database:
> > db.define_table('atable',
> >     Field('birth', 'date', default=None, writable=False),
> >     )
>
> > db.atable.birth.requires=IS_NULL_OR(IS_DATE())
> > db.atable.birth.writable = True
>
> > monthday = lambda value: value and '%i/%i' % (value.month, value.day)
> > db.atable.birth.represent = monthday
>
> > Controler:
> >     query = db.atable.id==1
> >     rows = db(query).select(db.atable.id, db.atable.birth)
> >     table = SQLTABLE(rows)
>
> > If you just use a crud.update, everything works fine, and the field
> > representation is correct.
>
> > However, when you try to use a TABLE to display a list of all records,
> > before going to the edit section, it seems the validator formatter
> > property is getting in the way.
>
> > Thank you for your help,
> > FG

-- 
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