As stated before this is not a web2py 2.0.x issue. The problem is that you
have
auth =Auth()
but you commented out
auth.define_tables()
yet you have a
{{=auth.navbar()}} in the layout.
You cannot have a navbar without defining tables. This would never have
worked and it should not work.
On Friday, 31 August 2012 12:28:44 UTC-5, Annet wrote:
>
> I encountered a similar issue:
>
>
> <type 'exceptions.AttributeError'> 'DAL' object has no attribute
> 'auth_user' Version web2py™ (2, 0, 3, datetime.datetime(2012, 8, 30, 21,
> 45, 50), 'stable') Python Python 2.6.1: /usr/bin/python2.6 Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
>
> Traceback (most recent call last):
> File "/Library/Python/2.6/site-packages/web2py/gluon/restricted.py", line
> 209, in restricted
> exec ccode in environment
> File
> "/Library/Python/2.6/site-packages/web2py/applications/init/views/appadmin.html"
> <http://127.0.0.1:8000/admin/default/edit/init/views/appadmin.html>, line
> 53, in <module>
> {{=form}}
> File "/Library/Python/2.6/site-packages/web2py/gluon/tools.py", line 1263,
> in navbar
> self.use_username = 'username' in self.table_user().fields
> File "/Library/Python/2.6/site-packages/web2py/gluon/tools.py", line 1155,
> in table_user
> return self.db[self.settings.table_user_name]
> File "/Library/Python/2.6/site-packages/web2py/gluon/dal.py", line 7101, in
> __getitem__
> return self.__getattr__(str(key))
> File "/Library/Python/2.6/site-packages/web2py/gluon/dal.py", line 7108, in
> __getattr__
> return ogetattr(self, key)
> AttributeError: 'DAL' object has no attribute 'auth_user'
>
> Error snapshot [image: help]
>
> <type 'exceptions.AttributeError'>('DAL' object has no attribute
> 'auth_user')
>
> inspect attributes
> Frames
>
> -
>
> *File /Library/Python/2.6/site-packages/web2py/gluon/restricted.py in
> restricted at line 209* code arguments variables
> -
>
> *File
>
> /Library/Python/2.6/site-packages/web2py/applications/init/views/appadmin.html
>
> in <module> at line 53* code arguments variables
> -
>
> *File /Library/Python/2.6/site-packages/web2py/gluon/tools.py in
> navbar at line 1263* code arguments variables
> -
>
> *File /Library/Python/2.6/site-packages/web2py/gluon/tools.py in
> table_user at line 1155* code arguments variables
> -
>
> *File /Library/Python/2.6/site-packages/web2py/gluon/dal.py in
> __getitem__ at line 7101* code arguments variables
> -
>
> *File /Library/Python/2.6/site-packages/web2py/gluon/dal.py in
> __getattr__ at line 7108* code arguments variables
> Function argument list
>
> (self=<DAL postgres://leonexus:Jag56#xj65@localhost:5432/leonexus>,
> key='auth_user')
> Code listing
>
> 7103.
> 7104.
> 7105.
> 7106.
> 7107.
> 7108.
>
> 7109.
> 7110.
> 7111.
> 7112.
>
> def __getattr__(self, key):
> if ogetattr(self,'_lazy_tables') and \
> key in ogetattr(self,'_LAZY_TABLES'):
> tablename, fields, args = self._LAZY_TABLES.pop(key)
> return self.lazy_define_table(tablename,*fields,**args)
> return ogetattr(self, key)
>
>
> def __setitem__(self, key, value):
> osetattr(self, str(key), value)
>
> Variables self <DAL
> postgres://leonexus:Jag56#xj65@localhost:5432/leonexus> global
> ogetattr <slot wrapper '__getattribute__' of 'object' objects> key
> 'auth_user'
>
>
>
> Kind regards,
>
> Annet
>
--