py4web: request.now not working

30 views
Skip to first unread message

Maurice Waka

unread,
Feb 19, 2020, 9:23:58 AM2/19/20
to web2py-users
Hello.

I'm still stuck at this error:

Field('modified_on', 'datetime', default=request.now(), update=request.now()),
  File "/usr/local/lib/python3.6/dist-packages/bottle.py", line 1400, in __getattr__
    raise AttributeError('Attribute %r not defined.' % name)
AttributeError: Attribute 'now' not defined.


Any help out there?
Regards

Alexander Hoch

unread,
Feb 19, 2020, 9:49:44 AM2/19/20
to web...@googlegroups.com
Try request.now with the function call (). only "default=request.now" and "update=request.now"

--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/4e1fba9b-a388-4846-a101-c40d7557a9b1%40googlegroups.com.

Maurice Waka

unread,
Feb 19, 2020, 10:32:40 AM2/19/20
to web...@googlegroups.com
Both do not work.

So I just got this:

 import datetime as dt

default = dt.datetime.utcnow()

You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/aAYTHke4pG4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAHAvb9yPqUb%2Bqf7d%2BVjP45Dj3-%3Dr-jGh5jMbVaLFi7MokNG-wQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages