You define table into za_arts_and_reviews()??

If you it may occurs that this controller is call before db.py where you
define your db connection...

Richard

On Wed, Feb 7, 2018 at 9:18 AM, Johann Spies <[email protected]> wrote:

> No.
>
> Regards
> Johann
>
> On 7 February 2018 at 16:10, Richard Vézina <[email protected]>
> wrote:
> > Do you make a module function call without passing the db to it??
> >
> > Richard
> >
> > On Wed, Feb 7, 2018 at 8:42 AM, Johann Spies <[email protected]>
> wrote:
> >>
> >> Version 2.16.1-stable+timestamp.2017.11.14.05.54.25
> >>
> >>
> >> Traceback (most recent call last):
> >>   File "/home/js/web2py/gluon/restricted.py", line 219, in restricted
> >>     exec(ccode, environment)
> >> AttributeError: 'DAL' object has no attribute 'db'
> >>
> >> During handling of the above exception, another exception occurred:
> >>
> >> Traceback (most recent call last):
> >>   File "/home/js/web2py/gluon/restricted.py", line 141, in __init__
> >>     self.traceback = traceback.format_exc()
> >> AttributeError: 'NoneType' object has no attribute 'strip'
> >>
> >> In file: /home/js/web2py/applications/wos_2017_2/controllers/
> indicators.py
> >>
> >>
> >> <code object <module> at 0x7fe51e5436f0, file
> >> "/home/js/web2py/applications/wos_2017_2/controllers/indicators.py",
> >> line 2>
> >>
> >> It happens when I call this function:
> >>
> >> # -*- coding: utf-8 -*-
> >> import datetime
> >> @auth.requires_login()
> >> def za_arts_and_reviews():
> >>     """
> >> some documentation about views declared in the background.
> >>
> >>     """
> >>     db.define_table('za_arts_reviews',
> >>                     Field('pubyear', 'integer'),
> >>                     Field('zitems', 'integer', rname='items'),
> >>                     migrate=False,
> >> rname='wos_2017_2.za_arts_and_reviews_by_year_v')
> >>
> >> ...
> >>
> >> Why this error?
> >>
> >> Regards
> >> Johann
> >>
> >> --
> >> Because experiencing your loyal love is better than life itself,
> >> my lips will praise you.  (Psalm 63:3)
> >>
> >> --
> >> 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.
> >
> >
> > --
> > 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.
>
>
>
> --
> Because experiencing your loyal love is better than life itself,
> my lips will praise you.  (Psalm 63:3)
>
> --
> 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.
>

-- 
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.

Reply via email to