Looks like somewhere you have a query 'dog.owner=5'. Instead, that should be:
dog.owner == 5 Note, no surrounding quotes, and use of == (to test equality) instead of = (used for assignment). Anthony On Friday, January 13, 2012 6:20:58 AM UTC-5, isi_jca wrote: > > Hello!!! > > I am a beginner and get the next ticket. Anybody Can I Help me?. Thanks in > advance. > > Ticket ID > > 127.0.0.1.2012-01-12.14-09-56.3407b807-6bc6-4428-a7f2-0173a5473524 > <type 'exceptions.AttributeError'> 'str' object has no attribute > 'ignore_common_filters' Version web2py™ (1, 99, 4, > datetime.datetime(2011, 12, 14, 14, 46, 14), 'stable') Python Python > 2.7.2+: /usr/bin/python Traceback > > 1. > 2. > 3. > 4. > 5. > 6. > 7. > 8. > 9. > 10. > 11. > 12. > 13. > 14. > 15. > 16. > > Traceback (most recent call last): > File "/home/jalbornoz/web2py/gluon/restricted.py", line 204, in restricted > exec ccode in environment > File > "/home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py" > <http://127.0.0.1:8000/admin/default/edit/ExpedienteX/controllers/default.py>, > line 135, in <module> > File "/home/jalbornoz/web2py/gluon/globals.py", line 172, in <lambda> > self._caller = lambda f: f() > File > "/home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py" > <http://127.0.0.1:8000/admin/default/edit/ExpedienteX/controllers/default.py>, > line 80, in list_records > records = db(query).select(db[table].ALL) > File "/home/jalbornoz/web2py/gluon/dal.py", line 6333, in select > return self.db._adapter.select(self.query,fields,attributes) > File "/home/jalbornoz/web2py/gluon/dal.py", line 1274, in select > sql = self._select(query, fields, attributes) > File "/home/jalbornoz/web2py/gluon/dal.py", line 1155, in _select > if query and not query.ignore_common_filters: > AttributeError: 'str' object has no attribute 'ignore_common_filters' > > Error snapshot [image: help] > > <type 'exceptions.AttributeError'>('str' object has no attribute > 'ignore_common_filters') > > inspect attributes > Frames > > - > > *File /home/jalbornoz/web2py/gluon/restricted.py in restricted at line > 204* code arguments variables > - > > *File > /home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py in > <module> at line 135* code arguments variables > - > > *File /home/jalbornoz/web2py/gluon/globals.py in <lambda> at line 172* > code arguments variables > - > > *File > /home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py in > list_records at line 80* code arguments variables > - > > *File /home/jalbornoz/web2py/gluon/dal.py in select at line 6333* code > arguments variables > - > > *File /home/jalbornoz/web2py/gluon/dal.py in select at line 1274* code > arguments variables > - > > *File /home/jalbornoz/web2py/gluon/dal.py in _select at line 1155* code > arguments variables > Function argument list > > (self=<gluon.dal.MySQLAdapter object>, query='dog.owner=5', > fields=[<gluon.dal.Field object>, <gluon.dal.Field object>, > <gluon.dal.Field object>], attributes={}) > Code listing > > 1150. > 1151. > 1152. > 1153. > 1154. > 1155. > > 1156. > 1157. > 1158. > 1159. > > else: > new_fields.append(item) > fields = new_fields > tablenames = self.tables(query) > > if query and not query.ignore_common_filters: > > query = self.common_filter(query,tablenames) > > if not fields: > for table in tablenames: > > Variables query 'dog.owner=5' query.ignore_common_filters undefined > > Context > > locals request session response > In file: > /home/jalbornoz/web2py/applications/ExpedienteX/controllers/default.py > > 1. > 2. > 3. > 4. > 5. > 6. > 7. > 8. > 9. > 10. > 11. > 12. > 13. > 14. > 15. > 16. > 17. > 18. > 19. > 20. > 21. > 22. > 23. > 24. > 25. > 26. > 27. > 28. > 29. > 30. > 31. > 32. > 33. > 34. > 35. > 36. > 37. > 38. > 39. > 40. > 41. > 42. > 43. > 44. > 45. > 46. > 47. > 48. > 49. > 50. > 51. > 52. > 53. > 54. > 55. > 56. > 57. > 58. > 59. > 60. > 61. > 62. > 63. > 64. > 65. > 66. > 67. > 68. > 69. > 70. > 71. > 72. > 73. > 74. > 75. > 76. > 77. > 78. > 79. > 80. > 81. > 82. > 83. > 84. > 85. > 86. > 87. > 88. > 89. > 90. > 91. > 92. > 93. > 94. > 95. > 96. > 97. > 98. > 99. > 100. > 101. > 102. > 103. > 104. > 105. > 106. > 107. > 108. > 109. > 110. > 111. > 112. > 113. > 114. > 115. > 116. > 117. > 118. > 119. > 120. > 121. > 122. > 123. > 124. > 125. > 126. > 127. > 128. > 129. > 130. > 131. > 132. > 133. > 134. > 135. > 136. > > # -*- coding: utf-8 -*- > # this file is released under public domain and you can use without > limitations > > ######################################################################### > ## This is a samples controller > ## - index is the default action of any application > ## - user is required for authentication and authorization > ## - download is for downloading files uploaded in the db (does streaming) > ## - call exposes all registered services (none by default) > ######################################################################### > @auth.requires_login() > def index(): > """ > example action using the internationalization operator T and flash > rendered by views/default/index.html or views/generic.html > """ > #response.flash = "Test Your English" > elemento = db().select(db.menu.ALL) > return dict(items=elemento) > # Permite realizar el ABM de las tablas de la aplicación, es llamada desde > setting.html > def menu(): > grid=SQLFORM > <http://127.0.0.1:8000/examples/global/vars/SQLFORM>.smartgrid(db[request > <http://127.0.0.1:8000/examples/global/vars/request>.args(0)],user_signature=True,deletable=True,editable=True,links_in_grid=True) > return locals() > > # Muestra las distintas opciones que se pueden configurar de la aplicación > def setting(): > return locals() > > def info(): > acercade ='Esta es mi primera Aplicación web hecha en Web2Py.' > return dict(informacion = acercade) > > # Muestra todos las pruebas > def alltest(): > prueba = db().select(db.prueba.ALL or redirect > <http://127.0.0.1:8000/examples/global/vars/redirect>(URL > <http://127.0.0.1:8000/examples/global/vars/URL>('index'))) > return dict(items=prueba) > > #Muestra las distintas frases que conforman una prueba. > def display_prueba(): > frase= db(db.oracion.nivel_id==request > <http://127.0.0.1:8000/examples/global/vars/request>.vars.id).select(db.oracion.ALL) > > # Estos datos son mostrados en la vista. > contador = 0 > prueba = request > <http://127.0.0.1:8000/examples/global/vars/request>.vars.leyenda > cantidad= request > <http://127.0.0.1:8000/examples/global/vars/request>.vars.cantidad > return dict(frase=frase,prueba = prueba, cantidad = cantidad,contador = > contador) > > def display_manual_form(): > record = db.person(request > <http://127.0.0.1:8000/examples/global/vars/request>.args(0)) > url = URL <http://127.0.0.1:8000/examples/global/vars/URL>('download') > form = SQLFORM > <http://127.0.0.1:8000/examples/global/vars/SQLFORM>(db.person, record, > deletable=True, > upload=url, fields=['name','surname', 'image']) > if request > <http://127.0.0.1:8000/examples/global/vars/request>.vars.image.filename: > form.vars.image_filename = request > <http://127.0.0.1:8000/examples/global/vars/request>.vars.image.filename > if form.accepts(request > <http://127.0.0.1:8000/examples/global/vars/request>.vars, session > <http://127.0.0.1:8000/examples/global/vars/session>): > response <http://127.0.0.1:8000/examples/global/vars/response>.flash > = 'form accepted' > elif form.errors: > response <http://127.0.0.1:8000/examples/global/vars/response>.flash > = 'form has errors' > return dict(form=form) > > def display_form(): > record = db.person(request > <http://127.0.0.1:8000/examples/global/vars/request>.args(0)) > url = URL <http://127.0.0.1:8000/examples/global/vars/URL>('download') > link = URL > <http://127.0.0.1:8000/examples/global/vars/URL>('list_records', args='db') > form = SQLFORM > <http://127.0.0.1:8000/examples/global/vars/SQLFORM>(db.person, record, > deletable=True, > upload=url, linkto=link) > if form.process().accepted: > response <http://127.0.0.1:8000/examples/global/vars/response>.flash > = 'form accepted' > elif form.errors: > response <http://127.0.0.1:8000/examples/global/vars/response>.flash = > 'form has errors' > return dict(form=form) > > > def download(): > return response > <http://127.0.0.1:8000/examples/global/vars/response>.download(request > <http://127.0.0.1:8000/examples/global/vars/request>, db) > > def list_records(): > table = request > <http://127.0.0.1:8000/examples/global/vars/request>.args(0) > query = request > <http://127.0.0.1:8000/examples/global/vars/request>.vars.query > records = db(query).select(db[table].ALL) > return dict(records=records) > > def user(): > """ > exposes: > http://..../[app]/default/user/login > http://..../[app]/default/user/logout > http://..../[app]/default/user/register > http://..../[app]/default/user/profile > http://..../[app]/default/user/retrieve_password > http://..../[app]/default/user/change_password > use @auth.requires_login() > @auth.requires_membership('group name') > @auth.requires_permission('read','table name',record_id) > to decorate functions that need access control > """ > return dict(form=auth()) > > > def download(): > """ > allows downloading of uploaded files > http://..../[app]/default/download/[filename] > """ > return response > <http://127.0.0.1:8000/examples/global/vars/response>.download(request > <http://127.0.0.1:8000/examples/global/vars/request>,db) > > > def call(): > """ > exposes services. for example: > http://..../[app]/default/call/jsonrpc > decorate with @services.jsonrpc the functions to expose > supports xml, json, xmlrpc, jsonrpc, amfrpc, rss, csv > """ > return service() > > > @auth.requires_signature() > def data(): > """ > http://..../[app]/default/data/tables > http://..../[app]/default/data/create/[table] > http://..../[app]/default/data/read/[table]/[id] > http://..../[app]/default/data/update/[table]/[id] > http://..../[app]/default/data/delete/[table]/[id] > http://..../[app]/default/data/select/[table] > http://..../[app]/default/data/search/[table] > but URLs must be signed, i.e. linked with > A('table',_href=URL('data/tables',user_signature=True)) > or with the signed load operator > LOAD('default','data.load',args='tables',ajax=True,user_signature=True) > """ > return dict(form=crud()) > > response <http://127.0.0.1:8000/examples/global/vars/response>._vars=response > <http://127.0.0.1:8000/examples/global/vars/response>._caller(list_records) > >