sure, I copied your view exactly, but is there anything different in the
view that you tested on your side?
{{extend 'layout.html'}}
<dl>
<dt>City</dt>
<dd>{{=city}}</dd>
<dt>Region</dt>
<dd>{{=region}}</dd>
<dt>Country</dt>
<dd>{{=country}}</dd>
</dl>
Do I need to define "city" in my controller? I get this error:
<type 'exceptions.NameError'> name 'city' is not definedVersionweb2py™Version
2.9.5-stable+timestamp.2014.03.16.02.35.39PythonPython 2.7.6:
/usr/local/bin/uwsgi (prefix: /usr)Traceback
1.
2.
3.
4.
5.
6.
Traceback (most recent call last):
File "/home/alexglaros/web2py/gluon/restricted.py", line 220, in restricted
exec ccode in environment
File
"/home/alexglaros/web2py/applications/engagementsquared/views/default/locate_me.html",
line 83, in <module>
NameError: name 'city' is not defined
Error snapshot [image: help]
<https://alexglaros.pythonanywhere.com/admin/default/ticket/engagementsquared/159.145.7.104.2015-10-01.15-19-10.88a1ba86-d8f9-48d8-8e16-9c3b7d3b9350#>
<type 'exceptions.NameError'>(name 'city' is not defined)
inspect attributes
Frames
-
*File /home/alexglaros/web2py/gluon/restricted.py in restricted at line
220* code arguments variables
-
*File
/home/alexglaros/web2py/applications/engagementsquared/views/default/locate_me.html
in <module> at line 83* code arguments variables
Function argument list
()
Code listing
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
response.write('\n </div>\n ', escape=False)
pass
response.write('\n\n <div class="', escape=False)
response.write(middle_columns)
response.write('">\n ', escape=False)
response.write('\n ', escape=False)
response.write('\n\n', escape=False)
response.write(location_data)
response.write('\n<dl>\n <dt>City</dt>\n <dd>', escape=False)
response.write(city)
response.write('</dd>\n <dt>Region</dt>\n <dd>{=region}}</dd>\n
<dt>Country</dt>\n <dd>{=country}}</dd>\n</dl>', escape=False)
response.write('\n ', escape=False)
response.write('\n </div>\n\n ', escape=False)
if right_sidebar_enabled:
response.write('\n <div class="span3">\n ',
escape=False)
response.write('\n <h3>Right Sidebar</h3>\n
<p></p>\n ', escape=False)
response.write('\n </div>\n ', escape=False)
pass
response.write('\n </section><!--/main-->\n\n <!-- Footer
================================================== -->\n\t <footer
class="footer" id="footer">\n \n<table id="over_arching_footer_table"
tr><td id="1st_column" width="33%" style="padding:25px">\n ',
escape=False)
response.write(' <!-- this is default footer -->\n <div
class="copyright pull-left"><ul>\n <li>Version 1.0 -
Engagement Squared </li>\n <li> ', escape=False)
thanks,
Alex
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.