This is a bug. the function update in gluon/contrib/gql.py should call
obj_represent(...,....,...) but it does not. Also perhaps the
validator IS_TIME should return a datetime.time instead of string.
I am going to need a couple of days to fix this, unless somebody send
me a patch sooner.
Massimo
On Dec 9, 12:03 pm, notabene <[EMAIL PROTECTED]> wrote:
> I have a table with a datetime field and a time-field ("varighed").
> Problem:
> The table can create records - but when updating through
> T2.form.accepts it fails
>
> It only fails on GAE. I can se that GAE internally saves the time
> field as a date-field?
>
> any ideas is appreaciated!
>
> Traceback (most recent call last):
> File "/base/data/home/apps/kultunauten/1.3265054032500774/gluon/
> restricted.py", line 62, in restricted
> exec ccode in environment
> File "/base/data/home/apps/kultunauten/1.3265054032500774/
> applications/kult/controllers/arr.py:update", line 67, in <module>
> File "/base/data/home/apps/kultunauten/1.329865054032500774/gluon/
> globals.py", line 55, in <lambda>
> self._caller=lambda f: f()
> File "/base/data/home/apps/kultunauten/1.3265054032500774/
> applications/kult/controllers/arr.py:update", line 59, in update
> File "/base/data/home/apps/kultunauten/1.3265054032500774/
> applications/plugin_t2/modules/t2.py", line 423, in update
> if form.accepts(request.vars,session):
> File "/base/data/home/apps/kultunauten/1.3265054032500774/gluon/
> sqlhtml.py", line 231, in accepts
> self.table._db(self.table.id==id).update(**fields)
> File "/base/data/home/apps/kultunauten/1.3265054032500774/gluon/
> contrib/gql.py", line 472, in update
> setattr(item,key,value)
> File "/base/python_lib/versions/1/google/appengine/ext/db/
> __init__.py", line 387, in __set__
> value = self.validate(value)
> File "/base/python_lib/versions/1/google/appengine/ext/db/
> __init__.py", line 1867, in validate
> (self.name, self.data_type.__name__))
> BadValueError: Property varighed must be a time
>
> Regards Niels
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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
-~----------~----~----~----~------~----~------~--~---