Hello, I'm learning to use web2py and created a small application and
deploy on GAE, in this app I have a action that return a xml:

#xml tags
def export_xml(rows):
    idx=range(len(rows.colnames))
    colnames=[item.replace('users.','') for item in rows.colnames]
    users=[]
    for row in rows.response: users.append(TAG['user']
(*[TAG[colnames[i]](row[i]) for i in idx]))
    return str(TAG['users'](*users))

#xml view
def lista():
    response.headers['Content-Type']='application/xml'
    return export_xml(db().select(db.auth_user.bio, db.auth_user.lat,
db.auth_user.lgt, db.auth_user.first_name, db.auth_user.country))

in localhost, this returns:

<users>
    <user>
        <auth_user.bio>User bio</auth_user.bio>
        <auth_user.lat>-31.0717547966</auth_user.lat>
        <auth_user.lgt>-51.3720578125</auth_user.lgt>
        <auth_user.first_name>Relsi</auth_user.first_name>
        <auth_user.country>Brazil</auth_user.country>
    </user>
</users>

but In GAE returns error:

In FILE: /base/data/home/apps/web2pyople/1.345301654218685961/
applications/init/controllers/default.py

Traceback (most recent call last):
  File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
restricted.py", line 178, in restricted
    exec ccode in environment
  File "/base/data/home/apps/web2pyople/1.345301654218685961/
applications/init/controllers/default.py:lista", line 45, in <module>
  File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
globals.py", line 96, in <lambda>
    self._caller = lambda f: f()
  File "/base/data/home/apps/web2pyople/1.345301654218685961/
applications/init/controllers/default.py:lista", line 43, in lista
  File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
contrib/gql.py", line 678, in select
    (items, tablename, fields) = self._select(*fields, **attributes)
  File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
contrib/gql.py", line 630, in _select
    table = self._get_table_or_raise()
  File "/base/data/home/apps/web2pyople/1.345301654218685961/gluon/
contrib/gql.py", line 609, in _get_table_or_raise
    raise SyntaxError, 'Set: no tables selected'
SyntaxError: Set: no tables selected

what am I doing wrong?

Reply via email to