def create():
form = SQLFORM(db.food_data,submit_button=T('Submit'))
form.element('input[value=Submit]')['_style']='background-color: #DA2128; color:#ffffff'
if form.process().accepted:
response.flash="form accepted"
redirect(URL('default', 'searching'))
return dict(form=form)Traceback (most recent call last):
File "/home/mauricewaka/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
File "/home/mauricewaka/web2py/applications/HWell/views/generic.html", line 81, in <module>
TypeError: 'dict_values' object does not support i
ndexing
--
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.
For more options, visit https://groups.google.com/d/optout.
{{=BEAUTIFY(list(response._vars.values())[0])}} if form.process().accepted:
session.flash="form accepted"This is a issue with generic.html. In Python 3 dict.values() does not return a list it returns a dict_values object.On line 10 of Generic.html wrap the values method call in list() and it works.{{=BEAUTIFY(list(response._vars.values())[0])}}
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/KwYsKUWgYnw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
Can someone file an issue on github and also attach the solution please? Thanks