I think you want to import from sqlhtml :
Try like this : from gluon.sqlhtml import * Richard On Mon, Mar 13, 2017 at 11:56 AM, Lars <[email protected]> wrote: > Hi, > > I have this small code in the dashboard module: > > from gluon.html import DIV > def get_dashboard(): > return DIV( > DIV('Lorat ipsum etc', _class='dashboard alert'), > _class='center-box').xml() > > and this one in default.py : > > def index(): > from modelling.dashboard import get_dashboard > dashboard = get_dashboard() > return dict(message=message, dashboard=dashboard > > > > And I noticed that if I refresh the page to quickly sometimes I have the > error : > global name DIV is not defined > > or some other, the css is not defined ? > > Could anybody figure why ? And how to avoid this ? > > Thank you, > > -- > 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.

