Can you show the relevant code (i.e., model definition and the login onaccept function)?
On Wednesday, September 10, 2014 4:34:41 AM UTC-4, Tommi Lahtonen wrote: > > I have no idea how to fix this error. I used this same code earlier in > google app engine and it worked just fine. Now I moved my app to ubuntu + > apache + postgresql and got this error: > > Error ticket for "viikko" Ticket ID > > 130.234.160.35.2014-09-10.08-14-09.e20b10b7-72bd-4f79-9618-948387ca1cf0 > <type 'exceptions.AttributeError'> 'Table' object has no attribute 'type' > Version web2py™ Version 2.9.5-stable+timestamp.2014.03.16.02.35.39 > Python Python 2.7.5+: /usr/bin/python (prefix: /usr) Traceback > > 1. > 2. > 3. > 4. > 5. > 6. > 7. > 8. > 9. > 10. > 11. > 12. > 13. > 14. > 15. > 16. > 17. > 18. > 19. > 20. > 21. > 22. > > Traceback (most recent call last): > File "/home/www-data/web2py/gluon/restricted.py", line 220, in restricted > ccode = compile2(code, layer) > File "/home/www-data/web2py/applications/viikko/controllers/default.py" > <https://tiea218.it.jyu.fi/admin/default/edit/viikko/controllers/default.py>, > line 166, in <module> > File "/home/www-data/web2py/gluon/globals.py", line 385, in <lambda> > self.menu = [] # used by the default view layout > File "/home/www-data/web2py/gluon/tools.py", line 3287, in f > def run_login_onaccept(self): > File "/home/www-data/web2py/applications/viikko/controllers/default.py" > <https://tiea218.it.jyu.fi/admin/default/edit/viikko/controllers/default.py>, > line 144, in omat > tehtavat = db(db.tehtava.palauttaja == user).select(db.tehtava, > orderby=db.tehtava.palautusaika) > File "/home/www-data/web2py/gluon/dal.py", line 10525, in select > def use_common_filters(query): > File "/home/www-data/web2py/gluon/dal.py", line 1869, in select > return cache_model( > File "/home/www-data/web2py/gluon/dal.py", line 1716, in _select > orderby = args_get('orderby', False) > File "/home/www-data/web2py/gluon/dal.py", line 1713, in geoexpand > inner_join = args_get('join', False) > File "/home/www-data/web2py/gluon/dal.py", line 8912, in __getitem__ > and fn is True and not field.uploadfs: > AttributeError: 'Table' object has no attribute 'type' > > Error snapshot [image: help] > <https://tiea218.it.jyu.fi/admin/default/ticket/viikko/130.234.160.35.2014-09-10.08-14-09.e20b10b7-72bd-4f79-9618-948387ca1cf0#> > > > <type 'exceptions.AttributeError'>('Table' object has no attribute 'type') > > inspect attributes > Frames > > - > > *File /home/www-data/web2py/gluon/restricted.py in restricted at line > 220* code arguments variables > - > > *File /home/www-data/web2py/applications/viikko/controllers/default.py > in <module> at line 166* code arguments variables > - > > *File /home/www-data/web2py/gluon/globals.py in <lambda> at line 385* > code arguments variables > - > > *File /home/www-data/web2py/gluon/tools.py in f at line 3287* code > arguments variables > - > > *File /home/www-data/web2py/applications/viikko/controllers/default.py > in omat at line 144* code arguments variables > - > > *File /home/www-data/web2py/gluon/dal.py in select at line 10525* code > arguments variables > - > > *File /home/www-data/web2py/gluon/dal.py in select at line 1869* code > arguments variables > - > > *File /home/www-data/web2py/gluon/dal.py in _select at line 1716* code > arguments variables > - > > *File /home/www-data/web2py/gluon/dal.py in geoexpand at line 1713* > code arguments variables > - > > *File /home/www-data/web2py/gluon/dal.py in __getitem__ at line 8912* > code arguments variables > Function argument list > > (self=<Table tehtava > (id,vt,taso,url_zip,kommentti,palauttaja,aika,palautusaika)>, key='type') > Code listing > > 8907. > 8908. > 8909. > 8910. > 8911. > 8912. > > 8913. > 8914. > 8915. > 8916. > > if db and db._adapter.uploads_in_blob is True: > uploadfields = [f.name for f in fields if f.type == 'blob'] > for field in fields: > fn = field.uploadfield > if isinstance(field, Field) and field.type == 'upload'\ > and fn is True and not field.uploadfs: > > fn = field.uploadfield = '%s_blob' % field.name > if isinstance(fn, str) and not fn in uploadfields and not > field.uploadfs: > fields.append(Field(fn, 'blob', default='', > writable=False, readable=False)) > > Variables field undefined builtinTrue True fn undefined > > Context > > locals request session response > -- 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.

