File "/home/alumno/web2py-git/gluon/restricted.py", line 217, in restricted
exec ccode in environment
File "/home/alumno/web2py-git/applications/myemail/controllers/appadmin.py", line 635, in <module>
File "/home/alumno/web2py-git/gluon/globals.py", line 378, in <lambda>
self._caller = lambda f: f()
File "/home/alumno/web2py-git/applications/myemail/controllers/appadmin.py", line 323, in update
f='download', args=request.args[:1]))
File "/home/alumno/web2py-git/gluon/sqlhtml.py", line 1098, in __init__
elif field.type.startswith('list:'):
AttributeError: type object 'list' has no attribute 'startswith'
And I think there could be other file sections with the same issue.
It can also be a SQLCustomType, but that class does have a .startswith() method.Anthony
On Sunday, September 15, 2013 4:56:43 AM UTC-4, Niphlod wrote:sorry alan, I'm missing the issue .... type should be always a string ('boolean', 'string', 'text', and so on). When does it bring a python object ?
It can also be a SQLCustomType, but that class does have a .startswith() method.Anthony
On Sunday, September 15, 2013 4:56:43 AM UTC-4, Niphlod wrote:sorry alan, I'm missing the issue .... type should be always a string ('boolean', 'string', 'text', and so on). When does it bring a python object ?
I'm searching for a reference in the web but unless I'm missing something DAL has been supporting field.type = <Python built-in>.
Also, I have recently modified the dal imap adapter so it defines dict object types because it deals with compound data for message parts. Should I rewrite those field definitions to use string types?
--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I believe this was your patch. It is aslo true that web2py relies on field.type.startswith(...).
BTW: In sqlhtml there are sections that are aware of field types not always being strings and other's that are not (wether they implement string methods or not), so I think this is because actually gluon did not always relied on string field types.
if we did, we should remove it promptly.
There are tons of code depending on type being always a string ... having to turn everything to check with isinstance() will leave too many open points.
I have to admit I have not looked at the code of this adapter in sufficient detail. Can we safely replace list with "list:string" here? What else should be changed?
I have to admit I have not looked at the code of this adapter in sufficient detail. Can we safely replace list with "list:string" here? What else should be changed?
I think it would make the imapadapter not to retrieve or render any message part. I would leave that code as it is until I have the time to rewrite the part retrieval logic (using a custom type). I don't think the current code affects anything in the core except using sqlform and including content or attachment fields (not available by default)
I have not checked all gluon, just sqlhtml.py, and there are a couple of lines that do:
if isinstance(field.type, str) and <whatever>
This is why I'm saying problably gluon did allow defining a field type as Python object (although it seems it is not documented in any way).