> email to web2py+un...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
@Anthony,could you provide a simple example?
db.define_table('mytable',
Field('name'),
Field('photo', 'upload'))def main_page():
return dict()
def form_component():
return dict(form=SQLFORM(db.mytable).process()){{=LOAD('form_component', ajax=True)}}max = db.table.date.max()
row = db().select(max)Traceback (most recent call last): File "/Users/web2py/web2py/gluon/main.py", line 445, in wsgibase serve_controller(request, response, session) File "/Users/web2py/web2py/gluon/main.py", line 180, in serve_controller page = run_controller_in(request.controller, request.function, environment) File "/Users/web2py/web2py/gluon/compileapp.py", line 660, in run_controller_in vars = vars.xml() File "/Users/web2py/web2py/gluon/packages/dal/pydal/objects.py", line 2497, in xml rv = self.db.represent('rows_xml', self) File "/Users/web2py/web2py/gluon/packages/dal/pydal/base.py", line 834, in represent return self.representers[name](*args, **kwargs) File "/Users/web2py/web2py/gluon/sqlhtml.py", line 3319, in __init__ tablemap = dict(((f.tablename, f.table) for f in fieldmap.values())) File "/Users/web2py/web2py/gluon/sqlhtml.py", line 3319, in <genexpr> tablemap = dict(((f.tablename, f.table) for f in fieldmap.values()))AttributeError: 'Expression' object has no attribute 'tablename'--
db.define_table('TABLE_of_sites', Field('site_id', 'reference sites'), Field('title', 'string'), Field('date','datetime'), ... Field('updated','datetime', update=request.now, writable=False), format='%(site_id)s' )table = 'TABLE_of_sites'
max = db[table].date.max()
row = db().select(max)
db(db[table]).select()To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
db.define_table('TABLE_of_sites', Field('site_id', 'reference sites'), Field('title', 'string'), Field('date','datetime'), ... Field('updated','datetime', update=request.now, writable=False), format='%(site_id)s' )table = db['TABLE_of_sites']
rows = db(table).select(distinct=table.title)
ProgrammingError: missing FROM-clause entry for table "table_of_sites"
LINE 1: SELECT DISTINCT ON (TABLE_of_sites.title) "TABLE_of...
^
SELECT DISTINCT ON (TABLE_of_sites.title) "TABLE_of_sites"."id", "TABLE_of_sites"."site_id", "TABLE_of_sites"."date", "TABLE_of_sites"."title" FROM "TABLE_of_sites" WHERE ("TABLE_of_sites"."id" IS NOT NULL);
"TABLE_of_sites"--
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 web2py+unsubscribe@googlegroups.com.
The one released yesterday is 2.15.1. The next one will be 2.15.2. (2.16.2 was a typo).
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
db(query).select(other_fields, aggregate, groupby=...etc..., orderby=...etc...)Are you saying that used to work but doesn't any longer?
How about db(db.table).select(max)?
Anthony
db(db.table).select(max)
Traceback (most recent call last): File "/Users/web2py/web2py/gluon/restricted.py", line 219, in restricted exec(ccode, environment) File "<string>", line 83, in <module> File "/Users/web2py/web2py/gluon/globals.py", line 422, in write self.body.write(to_native(xmlescape(data))) File "/Users/web2py/web2py/gluon/html.py", line 125, in xmlescape return to_bytes(data.xml()) File "/Users/web2py/web2py/gluon/html.py", line 960, in xml (fa, co) = self._xml() File "/Users/web2py/web2py/gluon/html.py", line 952, in _xml co = b''.join([xmlescape(component) for component in self.components]) File "/Users/web2py/web2py/gluon/html.py", line 125, in xmlescape return to_bytes(data.xml()) File "/Users/web2py/web2py/gluon/html.py", line 960, in xml (fa, co) = self._xml() File "/Users/web2py/web2py/gluon/html.py", line 952, in _xml co = b''.join([xmlescape(component) for component in self.components]) File "/Users/web2py/web2py/gluon/html.py", line 125, in xmlescape return to_bytes(data.xml()) File "/Users/web2py/web2py/gluon/html.py", line 960, in xml (fa, co) = self._xml() File "/Users/web2py/web2py/gluon/html.py", line 952, in _xml co = b''.join([xmlescape(component) for component in self.components]) File "/Users/web2py/web2py/gluon/html.py", line 125, in xmlescape return to_bytes(data.xml()) File "/Users/web2py/web2py/gluon/html.py", line 960, in xml (fa, co) = self._xml() File "/Users/web2py/web2py/gluon/html.py", line 952, in _xml co = b''.join([xmlescape(component) for component in self.components]) File "/Users/web2py/web2py/gluon/html.py", line 125, in xmlescape return to_bytes(data.xml()) File "/Users/web2py/web2py/gluon/html.py", line 960, in xml (fa, co) = self._xml() File "/Users/web2py/web2py/gluon/html.py", line 952, in _xml co = b''.join([xmlescape(component) for component in self.components]) File "/Users/web2py/web2py/gluon/html.py", line 125, in xmlescape return to_bytes(data.xml()) File "/Users/web2py/web2py/gluon/packages/dal/pydal/objects.py", line 2497, in xml rv = self.db.represent('rows_xml', self) File "/Users/web2py/web2py/gluon/packages/dal/pydal/base.py", line 834, in represent return self.representers[name](*args, **kwargs) File "/Users/web2py/web2py/gluon/sqlhtml.py", line 3319, in __init__ tablemap = dict(((f.tablename, f.table) for f in fieldmap.values())) File "/Users/web2py/web2py/gluon/sqlhtml.py", line 3319, in <genexpr> tablemap = dict(((f.tablename, f.table) for f in fieldmap.values()))AttributeError: 'Expression' object has no attribute 'tablename'
On Thursday, July 13, 2017 at 2:43:57 PM UTC-7, Anthony wrote:Are you saying that used to work but doesn't any longer?
There are 3 examples in the book at the link. They work in 2.14.6 using -S (and I did cut-n-paste to check).
How about db(db.table).select(max)?
Anthony
/dps
On Thursday, July 13, 2017 at 6:20:21 PM UTC-7, Dave S wrote:
On Thursday, July 13, 2017 at 2:43:57 PM UTC-7, Anthony wrote:Are you saying that used to work but doesn't any longer?
There are 3 examples in the book at the link. They work in 2.14.6 using -S (and I did cut-n-paste to check).They seem to work in 2.15.0b1.(Note: the examples depend on earlier examples, starting at "Other Operators".)
Traceback (most recent call last):
File "C:\Users\carlos.costa\Downloads\web2py\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
File "C:/Users/carlos.costa/Downloads/web2py/applications/teste/controllers/default.py", line 66, in <module>
File "C:\Users\carlos.costa\Downloads\web2py\gluon\globals.py", line 409, in <lambda>
self._caller = lambda f: f()
File "C:/Users/carlos.costa/Downloads/web2py/applications/teste/controllers/default.py", line 13, in teste
form = SQLFORM.factory(db.tabela.campo)
File "C:\Users\carlos.costa\Downloads\web2py\gluon\sqlhtml.py", line 1919, in factory
return SQLFORM(DAL(None).define_table(table_name, *fields),
File "C:\Users\carlos.costa\Downloads\web2py\gluon\packages\dal\pydal\base.py", line 587, in define_table
table = self.lazy_define_table(tablename, *fields, **args)
File "C:\Users\carlos.costa\Downloads\web2py\gluon\packages\dal\pydal\base.py", line 599, in lazy_define_table
table = table_class(self, tablename, *fields, **args)
File "C:\Users\carlos.costa\Downloads\web2py\gluon\packages\dal\pydal\objects.py", line 351, in __init__
field.bind(self)
File "C:\Users\carlos.costa\Downloads\web2py\gluon\packages\dal\pydal\objects.py", line 1633, in bind
'Field %s is already bound to a table' % self.longname)
ValueError: Field tabela.campo is already bound to a table
The same thing happened to me.
Please use Python3.
The same thing happened to me.
Please use Python3.
--
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 web2py+unsubscribe@googlegroups.com.
Don't forget to copy/paste (backup) you app before you try Python 3, because there is no way back with the app once you use it under python 3 as certain stuff are modify by python 3 that let your app unusable with python 2 after.
--
I recall having conversation about that, I am not sure, I think it language file or pickle objects that get modify in a no way back manner...
$.ajax('<url>', { data: JSON.stringify({ report: report outputFormat: 'pdf' }), type: "PUT", contentType: "application/json", ...
output_format = request.vars.outputFormat
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.