On Friday, April 1, 2016 at 2:23:25 PM UTC-7, lucas wrote:
>
> i think i figured it out. should be:
>
> try:
> from dal import Row
> have_row = True
> except:
> have_row = False
>
>
If that import fails in the web2py environment, you may have bigger
problems than instantiating a Row. ;-)
> tGross = db.gross_table
>
> def fxn():
> if have_row:
> try:
> sGross = Row()
> except Exception as e:
> error = "%s" % e
> s = ""
> for f in tGross.fields:
> sGross[f] = None
> s += "%s='%s', " % (f, tGross[f].default)
> s = s[:-2]
> return HTML(BODY("%s" % sGross, BR(), s))
>
>
> i know basic, but sometimes it is hard what modules to import when reading
> the API docs. lucas
>
Sometimes you do "less gluon/dal.py gluon/packages/pydal/objects.py"
/dps "some projects, that is the docs"
--
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.