More than a bug this is a missing feature. It does not yet allow to
specify
db(...).select('table.field')
as the old DAL did but only
db(...).select(db.table.field)
This will show in a few places since web2py sometimes passes the names
of fields as opposed to actual field objects.
On Feb 5, 6:09 pm, Thadeus Burgess <[email protected]> wrote:
> Can anyone confirm the following traceback when using
>
> SQLFORM.factory(*fields)
>
> ?
>
> Traceback (most recent call last):
> File "/home/tburgess/Applications/web2py/gluon/restricted.py", line
> 173, in restricted
> exec ccode in environment
> File
> "/home/tburgess/Applications/web2py/applications/pms/controllers/dashboard.py",
> line 248, in <module>
> File "/home/tburgess/Applications/web2py/gluon/globals.py", line 96,
> in <lambda>
> self._caller = lambda f: f()
> File "/home/tburgess/Applications/web2py/gluon/tools.py", line 1874, in f
> return action(*a, **b)
> File
> "/home/tburgess/Applications/web2py/applications/pms/controllers/dashboard.py",
> line 168, in allocation
> table_name="allocate"
> File "/home/tburgess/Applications/web2py/gluon/sqlhtml.py", line
> 905, in factory
> **attributes)
> File "/home/tburgess/Applications/web2py/gluon/sqlhtml.py", line
> 591, in __init__
> inp = field.widget(field, default)
> File "/home/tburgess/Applications/web2py/gluon/sqlhtml.py", line
> 226, in widget
> options = field.requires.options()
> File "/home/tburgess/Applications/web2py/gluon/validators.py", line
> 377, in options
> self.build_set()
> File "/home/tburgess/Applications/web2py/gluon/validators.py", line
> 361, in build_set
> records = self.dbset.select(*self.fields, **dd)
> File "/home/tburgess/Applications/web2py/gluon/sql.py", line 3207, in select
> return self._db._adapter.select(self._query,*fields,**attributes)
> File "/home/tburgess/Applications/web2py/gluon/sql.py", line 499, in select
> query = self.SELECT(query,*fields, **attributes)
> File "/home/tburgess/Applications/web2py/gluon/sql.py", line 430, in SELECT
> tablenames.append(f._tablename)
> AttributeError: 'str' object has no attribute '_tablename'
>
> -Thadeus
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.