(2, 0, 9, datetime.datetime(2012, 9, 13, 23, 51, 30), 'stable') Python Python
2.7.3: /usr/bin/python Traceback
1.
2.
3.
4.
5.
6.
7.
8.
Traceback (most recent call last):
File "/home/www-data/web2py/gluon/restricted.py", line 209, in restricted
exec ccode in environment
File "/home/www-data/web2py/applications/comisiones/views/default/map.html",
line 98, in <module>
File "/home/www-data/web2py/applications/comisiones/controllers/default.py"
<https://localhost/admin/default/edit/comisiones/controllers/default.py>, line
81, in <lambda>
maker = lambda point: A(row.name,_href='...'),
NameError: global name 'row' is not defined
El jueves, 5 de abril de 2012 20:54:32 UTC-3, Massimo Di Pierro escribió:
>
> Example:
>
> # model
> db.define_table('point',
> Field('name'),
> Field('latitude','double'),
> Field('longitude','double'))
>
> #controller
> def map():
> return dict(
> googlemap_key='...', # get this from google maps
> center_latitude = 41.878,
> center_longitude = -87.629,
> scale = 7,
> maker = lambda point: A(row.name,_href='...')
> points = db(db.point).select()
> )
>
> #in views/defaut/map.html:
>
> {{extend 'layout.html'}}
> <center>
> <h2>My Map</h2>
> {{include 'generic.map'}}
> </center>
>
>
--