'module' object has no attribute 'startswith'

1,039 views
Skip to first unread message

Johann Spies

unread,
Sep 3, 2015, 3:01:43 AM9/3/15
to web...@googlegroups.com
We have an app working with a database on another server through an ssh-tunnel.

The app is working.  But the admin app which worked previously suddenly throws an error when one try to we tries the "database administration" button - but only for this app.

The traceback is this:

Traceback (most recent call last):
File "/home/js/web2py/gluon/restricted.py", line 227, in restricted
exec ccode in environment
File "/home/js/web2py/applications/wos_2015_3/views/appadmin.html", line 93, in <module>
{{
tablename=request.args[1]}}
File "/home/js/web2py/gluon/packages/dal/pydal/base.py", line 899, in __getitem__
return self.__getattr__(str(key))
File "/home/js/web2py/gluon/packages/dal/pydal/base.py", line 905, in __getattr__
return self.lazy_define_table(tablename, *fields, **args)
File "/home/js/web2py/gluon/packages/dal/pydal/base.py", line 845, in lazy_define_table
field.represent = auto_represent(field)
File "/home/js/web2py/gluon/packages/dal/pydal/helpers/methods.py", line 286, in auto_represent
if field.db and field.type.startswith('reference') and \
AttributeError: 'module' object has no attribute 'startswith'

How do I debug this?

migrate = False for all the tables with fake_migrate on for the auth_related tables.

Regards
Johann

--
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

Richard Vézina

unread,
Sep 4, 2015, 10:38:11 AM9/4/15
to web2py-users
Could it be possible that you upgrade web2py but not the appadmin controller?

Richard

--
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 web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Massimo Di Pierro

unread,
Sep 6, 2015, 12:50:40 AM9/6/15
to web2py-users
Somewhere in Field('<name>','<type>') is not a string. perhaps quotes are missing.
Reply all
Reply to author
Forward
0 new messages