web2py 2.15.0b1

740 views
Skip to first unread message

Massimo Di Pierro

unread,
Jul 5, 2017, 2:55:21 AM7/5/17
to web2py-users
Please help us test the new web2py:


Personally and on behalf of the community: thanks to everybody who has contributed! 

It has been a year but we piled up a huge number of small changes and bug fixes.

## 2.16.0b1

- experimental python 3 support

- experimental authapi for service login

- more tests

- d3.js model visulization

- improved scheduler

- is_email support for internationalized Domain Names

- improved used of cookies with CookieJar

- SQLFORM.grid(showblobs=True)

- import JS events (added w2p.componentBegin event)

- added support for CASv3

- allow first_name and last_name placeholders in verify_email message

- added three-quote support in markmin

- updated pg8000 driver (but we still recommend psycopg2)

- compiled views use . separator not _ separator (must recompile code)

- better serbian, french, and catalan translations

- speed improvements (refactor of compileapp and pyc caching)

- removed web shell (never worked as intended)

- allow Expose(..., follow_symlink_out=False).

- Updated fpdf to latest version

- JWT support

- import fabfile for remote deployment

- jQuery 3.2.1

- PyDAL 17.07 including:

  allow jsonb support for postgres

  correctly configure adapters that need connection for configuration

  better caching

  updated IMAP adapter methods to new API

  experimental suport for joinable subselects

  improved Teradata support

  improved mongodb support

  overall refactoring

  experimental support for Google Cloud SQL v2

黄祥

unread,
Jul 5, 2017, 4:51:06 AM7/5/17
to web2py-users
great jobs massimo and everyone, just found some on the latest version
1. admin page, manage button (dropdown menu) not work (no errors occured)
2. before insert callback (put it on module) is not work in latest version, while the same code and same step is work in 2.14.6-stable

Traceback (most recent call last):
  File "/Users/MacBookPro/site/web2py/gluon/restricted.py", line 219, in restricted
    exec(ccode, environment)
  File "/Users/MacBookPro/site/web2py/applications/test/controllers/install.py", line 422, in <module>
  File "/Users/MacBookPro/site/web2py/gluon/globals.py", line 406, in <lambda>
    self._caller = lambda f: f()
  File "/Users/MacBookPro/site/web2py/applications/test/controllers/install.py", line 208, in index
    redemption_unit_plan = 0)
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/objects.py", line 731, in insert
    row = self._fields_and_values_for_insert(fields)
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/objects.py", line 709, in _fields_and_values_for_insert
    'Table: missing required field: %s' % name)
RuntimeError: Table: missing required field: fund_manager

step i took start new web app from scratch from terminal with (same steps with same code works in 2.14.6 but an error occured in latest version) :
cd
rm -rf ~/site/web2py/applications/test
cp -R ~/site/web2py/applications/welcome/ ~/site/web2py/applications/test
rsync -zavr ~/Programming/Python/Web2py/test ~/site/web2py/applications/
rsync -zavur ~/Programming/Python/Web2py/test ~/site/web2py/applications/

code in line 208
controllers/install.py
def index():
# code removed till line 208
db.account.insert(account_no = '1', investor = 1, product = 5, selling_agent = 1, 
 nav_date = '2016-01-01', min_redemption = 1, target_duration = 0, 
 target_nav = 1, target_profit_n_loss = 0, target_profit_n_loss_percentage = 0, 
 redemption_plan = 'Profit, Amount Redeem > 1, Amount Redeem < Profit', 
 redemption_unit_plan = 0)

modules/callback.py
def before_insert_account(f):
query_product = (current.db.product.id == f['product'] )
row_product = current.db(query_product).iterselect(cache = (current.cache.ram, 3600), 
  cacheable = True).first()
f['fund_manager'] = int(row_product.fund_manager)
f['custodian_bank'] = int(row_product.custodian_bank)
f['currency'] = int(row_product.currency)
delta = datetime.timedelta(days = int(row_product.duration) )
f['redemption_date_plan'] = datetime.datetime.strptime(f['nav_date'], '%Y-%m-%d') + delta

thanks and best regards,
stifan

António Ramos

unread,
Jul 5, 2017, 5:01:06 AM7/5/17
to web...@googlegroups.com
on windows,  in admin, the "Manage" Button does not pull dow..

--
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.
For more options, visit https://groups.google.com/d/optout.

Leonel Câmara

unread,
Jul 5, 2017, 6:37:13 AM7/5/17
to web2py-users
@stifan but you actually did not put any fund_manager

@ramos what browser? it's working fine for me in chrome, firefox and edge.

António Ramos

unread,
Jul 5, 2017, 6:51:51 AM7/5/17
to web...@googlegroups.com
@leonel 
@windows 7 /Chrome/Firefox/Internet Explorer

2017-07-05 11:37 GMT+01:00 Leonel Câmara <leonel...@gmail.com>:
@stifan but you actually did not put any fund_manager

@ramos what browser? it's working fine for me in chrome, firefox and edge.

--

Leonel Câmara

unread,
Jul 5, 2017, 7:52:09 AM7/5/17
to web2py-users
Ramos have you done a hard refresh, It's very odd because I don't see that error at all.

António Ramos

unread,
Jul 5, 2017, 10:25:21 AM7/5/17
to web...@googlegroups.com
tried chrome with a hard refresh  and i got this after pressing the "Manage " button
Imagem inline 1

2017-07-05 12:52 GMT+01:00 Leonel Câmara <leonel...@gmail.com>:
Ramos have you done a hard refresh, It's very odd because I don't see that error at all.

--

黄祥

unread,
Jul 5, 2017, 11:01:50 AM7/5/17
to web2py-users
@leonel :
- for before_insert callback problem
yes, you are right, i intentionally didn't put fund_manager value because i want to test the before_insert callback during insert data on install controller
the same code running well in previous version 2.14.6-stable
- for admin page manage button problem test on mac os x with chrome browser and web2py source

Leonel Câmara

unread,
Jul 5, 2017, 12:17:11 PM7/5/17
to web2py-users
My bad I'm still using the old jquery version.

黄祥

unread,
Jul 5, 2017, 8:20:25 PM7/5/17
to web2py-users
tried to build from scratch with minimal code for test before insert callback problem :
1. create new web2py app
2. models/db_test.py
def before_insert_test(f):
    f['field1'] = 'field1'

db.define_table('table0', 
    Field('field0', notnull = True, required = True), 
    Field('field1', notnull = True, required = True) )

db.table0._before_insert.append(before_insert_test)

3. controllers/install.py
def index():
    db.table0.insert(field0 = 'field0')

4. error result
Traceback (most recent call last):
  File "/Users/MacBookPro/site/web2py/gluon/restricted.py", line 219, in restricted
    exec(ccode, environment)
  File "/Users/MacBookPro/site/web2py/applications/test/controllers/install.py", line 6, in <module>
  File "/Users/MacBookPro/site/web2py/gluon/globals.py", line 406, in <lambda>
    self._caller = lambda f: f()
  File "/Users/MacBookPro/site/web2py/applications/test/controllers/install.py", line 4, in index
    db.table0.insert(field0 = 'field0')
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/objects.py", line 731, in insert
    row = self._fields_and_values_for_insert(fields)
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/objects.py", line 709, in _fields_and_values_for_insert
    'Table: missing required field: %s' % name)
RuntimeError: Table: missing required field: field1

5. temporary solution
i know there are 2 temporary solutions for this:
1. remove notnull=True and required=True
2. set the value for required value, e.g. field1 during insert

6. question
the same code work in previous stable version (2.14.6-stable), is it a problem or normal in web2py latest version?

黄祥

unread,
Jul 5, 2017, 10:22:21 PM7/5/17
to web2py-users
another test
1. can't use response.optimize_js in models/db.py, previous version can work
response.optimize_js = 'concat,minify,inline'

Traceback (most recent call last):
  File "/Users/MacBookPro/site/web2py/gluon/restricted.py", line 219, in restricted
    exec(ccode, environment)
  File "<string>", line 36, in <module>
  File "/Users/MacBookPro/site/web2py/gluon/globals.py", line 501, in include_files
    time_expire)
  File "/Users/MacBookPro/site/web2py/gluon/cache.py", line 247, in __call__
    value = f()
  File "/Users/MacBookPro/site/web2py/gluon/globals.py", line 496, in call_minify
    self.optimize_js)
  File "/Users/MacBookPro/site/web2py/gluon/contrib/minify/minify.py", line 101, in minify
    contents = read_binary_file(abs_filename)
  File "/Users/MacBookPro/site/web2py/gluon/contrib/minify/minify.py", line 19, in read_binary_file
    f = open(filename, 'rb')
IOError: [Errno 2] No such file or directory: '/Users/MacBookPro/site/web2py/applications/welcome/static/min.js'

graph model didn't show the erd like in previous version :
- relation between table not shown
- table fields shown is stacked with another table name

3. appadmin errors page didn't show current request, response, session like in previous version

Martin Weissenboeck

unread,
Jul 6, 2017, 2:08:23 AM7/6/17
to web2py-users
Hi, nice to have a new version.
The problems with markmin2html remain, see issue 1671

A short summary - an ordered list inside a blockquote does not work:

A controller:

def mmtest():
    t="""

-----------
  This is an ordered list:
  + Item 1
  + Item 2
---------:blockquoteclass[blockquoteid]

"""
    return MARKMIN(t)

​The expected result is:
<blockquote class="blockquoteclass" id="markmin_blockquoteid"><p>This is an ordered list:</p><ol><li>Item 1</li><li>Item 2</li></ol></blockquote>

But instead I get:​

<blockquote class="blockquoteclass" id="markmin_blockquoteid">  This is an ordered list:
  + Item 1
  + Item 2</blockquote>

'\n'.join(strings[bq_begin:lineno]), pp)


If markmin detects a blockquote, it joins the whole text inside and does nothing else.

Now change this line to

render('\n'.join(strings[bq_begin:lineno])), pp)


and you will get the expected result.

And there is another problem in this new markmin2html.py:
markmin2html needs now gluon and therefore it is not longer a standalone program.

And: all links in the lines 228 ... 230 do not work. There should be the actual links.

Regards, Martin


Dave S

unread,
Jul 6, 2017, 5:23:26 AM7/6/17
to web2py-users


On Wednesday, July 5, 2017 at 7:22:21 PM UTC-7, 黄祥 wrote:
 
graph model didn't show the erd like in previous version :
- relation between table not shown
- table fields shown is stacked with another table name

 
Also seen on older Fedora, recent Firefox

/dps

Dave S

unread,
Jul 6, 2017, 5:24:42 AM7/6/17
to web2py-users

On Wednesday, July 5, 2017 at 2:01:06 AM UTC-7, Ramos wrote:
on windows,  in admin, the "Manage" Button does not pull dow..

Also seen on older Fedora newer Firefox.

/dps
 

Dave S

unread,
Jul 6, 2017, 5:27:05 AM7/6/17
to web2py-users

On Tuesday, July 4, 2017 at 11:55:21 PM UTC-7, Massimo Di Pierro wrote:
Please help us test the new web2py:


Personally and on behalf of the community: thanks to everybody who has contributed! 

It has been a year but we piled up a huge number of small changes and bug fixes.


Are there still pull requests pending on the book?

/dps

Dave S

unread,
Jul 6, 2017, 5:31:03 AM7/6/17
to web2py-users
Oh, and my progress report:

Some simple  tests done so far, including an fpdf page.  Server and client are both on an older Fedora system with a recent Firefox, Python 2.7.something.

The only problems I've seen are the me-toos I posted (manage button, graph links)

/dps

黄祥

unread,
Jul 6, 2017, 5:49:01 AM7/6/17
to web2py-users
just curious how do you shipping the package, for example, i just found there is fabfile.py in the root of web2py folder on github, but not in the web2py_src.zip
i want to test fabfile.py too, and must grab it from github, not from the source one
Message has been deleted

Dave S

unread,
Jul 6, 2017, 6:29:11 AM7/6/17
to web2py-users
On Windows (with the web2py_win package), 2 apps being ported have had DAL-related errors.

For one, where I copied the storage.sqlite file over,

<type 'exceptions.KeyError'> 'Column QuarterMaster.IssueYr not found (SQLTABLE)'

Version

web2py™Version 2.15.0-beta+timestamp.2017.07.05.06.50.17
PythonPython 2.7.9: C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\web2py.exe (prefix: )

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
Traceback (most recent call last
):
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
File "<string>", line 77, in <module>
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\sqlhtml.py", line 3400, in __init__
"Column %s not found (SQLTABLE)" % colname)
KeyError: 'Column QuarterMaster.IssueYr not found (


For the other, my controller does the usual "form = SQFORM(db.tab2)", where tab2 has a field "partof" ref tab1, and a string field I want to get autofocus, so I set the widget, and I set the default value for a boolean field according to a request.vars value.  I get a format error:

4.
35.
36.
37.
38.
39.
40.
Traceback (most recent call last
):
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
File "C:/Users/Dave/web2py_win/web2py_win-2.15.0b1/web2py/applications/shortcuts/controllers/default.py", line 178, in <module>
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\globals.py", line 406, in <lambda>
self._caller = lambda f: f
()
File "C:/Users/Dave/web2py_win/web2py_win-2.15.0b1/web2py/applications/shortcuts/controllers/default.py", line 56, in addsegment
form = SQLFORM(db.segment)
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\sqlhtml.py", line 1406, in __init__
inp = self.widgets.options.widget(field, default)
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\sqlhtml.py", line 324, in widget
options = requires[0].options()
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\validators.py", line 600, in options
self.build_set()
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\validators.py", line 586, in build_set
records = self.dbset(table).select(*fields, **dd)
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\packages\dal\pydal\objects.py", line 2211, in select
return adapter.select(self.query, fields, attributes)
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\packages\dal\pydal\adapters\sqlite.py", line 82, in select
return super(SQLite, self).select(query, fields, attributes)
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\packages\dal\pydal\adapters\base.py", line 760, in select
return self._select_aux(sql, fields, attributes, colnames)
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\packages\dal\pydal\adapters\base.py", line 739, in _select_aux
return processor(rows, fields, colnames, cacheable=cacheable)
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\packages\dal\pydal\adapters\base.py", line 305, in parse
for row in rows
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\packages\dal\pydal\adapters\base.py", line 231, in _parse
value = self.parse_value(value, fit, ft, blob_decode)
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\packages\dal\pydal\adapters\base.py", line 198, in parse_value
return self.parser.parse(value, field_itype, field_type)
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\packages\dal\pydal\parsers\__init__.py", line 101, in parse
return self.registered[field_itype](value, field_type)
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\packages\dal\pydal\parsers\__init__.py", line 76, in __call__
return self.call(value, field_type)
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\packages\dal\pydal\parsers\__init__.py", line 70, in _call_with_extras
return self.f(self.parser, value, **extras)
File "C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\packages\dal\pydal\parsers\sqlite.py", line 19, in _decimal
value = ('%.' + decimals + 'f') % value
ValueError: unsupported format character ' ' (0x20) at index 2


Paolo Valleri

unread,
Jul 6, 2017, 3:42:20 PM7/6/17
to web2py-users
Hi Stifan,
regarding _before_insert open an issue on https://github.com/web2py/pydal with the example you posted
for the other issues, open an issue on https://github.com/web2py/web2py

Paolo

Donald McClymont

unread,
Jul 6, 2017, 6:52:36 PM7/6/17
to web2py-users
Excellent work with this and lots of new features.  

No major issues with doing some testing so far - but just sharing an observation that a field definition along the lines of: below will cause an error if you insert a record and it attempts to use the default value.

Field('plan_editor', 'list:reference auth_user', label='Plan Editors', default=auth.user_id) 

was valid on 2.14.x but now throws an error that the id is not an iterable so it needs to be amended to:

Field('plan_editor', 'list:reference auth_user', label='Plan Editors', default=[auth.user_id]),

Which is probably the way I should have defined it in the first place as it is a list after all - however just sharing for awareness as it can be a breaking change.  

Regards
Donald

黄祥

unread,
Jul 6, 2017, 7:09:13 PM7/6/17
to web2py-users
Done in pydal issue
_before_insert not work when required=True in latest version

Done in web2py issue
appadmin errors page didn't show detail information
admin page, manage button (dropdown) not work (no errors occured)
graph model didn't show the erd like in previous version
can't use response.optimize_js in models/db.py, previous version can work

黄祥

unread,
Jul 6, 2017, 11:20:58 PM7/6/17
to web2py-users
tried routes in applications
1. cp ~/site/web2py/examples/routes.parametric.example.py ~/site/web2py/routes.py
2. cp ~/site/web2py/applications/welcome/routes.example.py ~/site/web2py/applications/welcome/routes.py
3. Start Web2py
source ~/site/bin/activate
python ~/site/web2py/web2py.py --nogui --no-banner -a 'a' -i 0.0.0.0 -p 8000

Result when start web2py
Traceback (most recent call last):
  File "/Users/MacBookPro/site/web2py/web2py.py", line 21, in <module>
    import gluon.widget
  File "/Users/MacBookPro/site/web2py/gluon/widget.py", line 26, in <module>
    from gluon import main, newcron
  File "/Users/MacBookPro/site/web2py/gluon/main.py", line 120, in <module>
    load_routes()
  File "/Users/MacBookPro/site/web2py/gluon/rewrite.py", line 380, in load
    load(routes, appname)
  File "/Users/MacBookPro/site/web2py/gluon/rewrite.py", line 320, in load
    exec(data, symbols)
  File "<string>", line 23, in <module>
ImportError: No module named fileutils

already tried to edit ~/site/web2py/applications/welcome/routes.py too, but still have the same problem
routers = {
    welcome: dict(
        default_language=possible_languages['default'][0],
        languages=[lang for lang in possible_languages if lang != 'default']
    )
}

any idea how to make it work?

黄祥

unread,
Jul 6, 2017, 11:37:02 PM7/6/17
to web2py-users
the error traceback about routes in application is fixed with
applications/test/routes.py
from gluon.fileutils import abspath
from gluon.languages import read_possible_languages

but the same problem is still exist, (no error occured but the result is not expected), what i expect is something like in book said 

how i can achieve using web2py way?

Dave S

unread,
Jul 7, 2017, 4:55:33 AM7/7/17
to web2py-users


On Thursday, July 6, 2017 at 3:29:11 AM UTC-7, Dave S wrote:
[...]
This is whistled down at 

File C:\Users\Dave\web2py_win\web2py_win-2.15.0b1\web2py\gluon\packages\dal\pydal\parsers\sqlite.py in _decimal at line 19 code arguments variables

Function argument list

(self=<pydal.parsers.sqlite.SQLiteParser object>, value=3.1, decimals=' 1')

Code listing
14.
15.
16.
17.
18.
19.

20.
21.
22.
23.
    def decimal_extras(self, field_type):
return {'decimals': field_type[8:-1].split(',')[-1]}

@for_type('decimal')
def _decimal(self, value, decimals):

value = ('%.' + decimals + 'f') % value

        return Decimal(value)

@for_type('date')
def _date(self, value):
Variables
decimals' 1'
value3.1
 

I'm not sure where the "3.1" comes from, but the error might have been 
Field("duration", "decimal(5, 1)", default=None, writable=False),
instead of 
Field("duration", "decimal(5,1)", default=None, writable=False),

/dps


Dave S

unread,
Jul 7, 2017, 6:52:43 PM7/7/17
to web...@googlegroups.com
[sorry for the American Football lingo]
 

Note that line 15 above, which seems to prep for the line in question,  does a split(",") but does not trim.

/dps

Massimo Di Pierro

unread,
Jul 10, 2017, 4:28:44 AM7/10/17
to web2py-users
Thanks for reporting these issues.

I think except for minification they have all been resolved. and a new beta version is released.

Paolo Valleri

unread,
Jul 10, 2017, 12:30:42 PM7/10/17
to web2py-users
Massimo, regarding minification see https://github.com/web2py/web2py/pull/1658, hopefully it fixed the reported issue.

Richard Vézina

unread,
Jul 10, 2017, 12:45:36 PM7/10/17
to web2py-users
Hello,

Welcome is pretty slow 500+ ms compare to 32 ms for 2.14.6??

Richard

--

Richard Vézina

unread,
Jul 10, 2017, 12:55:36 PM7/10/17
to web2py-users
Sorry I was wrong... I miss read result I can't get slow result again...

kato

unread,
Jul 10, 2017, 3:56:58 PM7/10/17
to web2py-users
Hi.

I found a problem with python3.

File ".../web2py/gluon/validators.py", line 455, in options
    items = [(k, self.labels[i]) for (i, k) in enumerate(self.theset)]
File ".../web2py/gluon/validators.py", line 455, in <listcomp>
    items = [(k, self.labels[i]) for (i, k) in enumerate(self.theset)]
TypeError: 'dict_values' object does not support indexing

line455
items = [(k, self.labels[i]) for (i, k) in enumerate(self.theset)]

Please change as follows.
items = [(k, list(self.labels)[i]) for (i, k) in enumerate(self.theset)]



Jacinto Parga

unread,
Jul 13, 2017, 3:45:11 AM7/13/17
to web2py-users
Great job. Thanks.

First issue with @mobilize import


from gluon.contrib.user_agent_parser import mobilize

villas

unread,
Jul 18, 2017, 1:25:54 PM7/18/17
to web2py-users
Re:  Firebird

I just tested this version of web2py and I noticed a problem.  See the new authapi.py,  line 452:

rows = self.db(self.table_group().role == role).select()


The new code produces this SQL:
SELECT "auth_group"."id", "auth_group"."role", "auth_group"."description" FROM "auth_group" WHERE ("auth_group"."role" = 'admin')

The old code in tools.py produced this:
SELECT  auth_group.id, auth_group.role, auth_group.description FROM auth_group WHERE (auth_group.role = 'admin')

So what's the problem?
Firebird,  by default,  creates all entity names in uppercase.  This is not usually a problem because the SQL is interpreted as case-insensitive.
However,  when the names are quoted,  they become case-sensitive and therefore the new code doesn't work.

The solution for Firebird?
Either,  uppercase the entity names before they are quoted,  or dispense with the quotes (as in the old code).



Leonel Câmara

unread,
Jul 18, 2017, 1:59:13 PM7/18/17
to web2py-users
Villas can you submit an issue to pydal. Seems like a bug if we were not using quotes before we probably should not be using them at all.

villas

unread,
Jul 18, 2017, 5:40:08 PM7/18/17
to web2py-users
Hi Leonel

Thanks for your suggestion and I created an issue on pyDal. 
The quoting tends to work ok with DBs which default to lowercase,  unfortunately Firebird is uppercase.  As you say, it would probably be better not to use quotes at all because it will probably cause more issues than resolve problems.

Best regards. 

villas

unread,
Jul 20, 2017, 8:38:42 AM7/20/17
to web2py-users
Just to leave a note for anyone researching my Firebird issue...

I see that Firebird has breaking backward-compatibility in web2py from change introduced here:
https://github.com/web2py/pydal/pull/365

Entities are quoted by default which can cause issues.  The work around is to do the following in the DAL declaration:

DAL('firebird://SYSDBA:password@....',   .......
       ignore_field_case=True, entity_quoting=False,
       ........ )



Oliver Holmes

unread,
Jul 31, 2017, 5:56:56 AM7/31/17
to web2py-users
Hi,

just extracted 2.15.2-stable over my 2.14.6-stable, prior to that had stopped all services related to web2py, and now whenever I try to access one of my own tables, not web2pys system tables like auth_user or scheduler_task, I get the following error (same for every attempt to access tables):

<class 'psycopg2.ProgrammingError'> column gdt_config.fkEntbindungsdatum does not exist LINE 1: ...fig"."gdtversion", "gdt_config"."gdtzeichensatz", "gdt_confi... ^

Version

web2py™ Version 2.15.2-stable+timestamp.2017.07.19.12.18.41
Python Python 2.7.9: /usr/bin/python (prefix: /usr)

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.

14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
Traceback (most recent call last
):
File "/home/www-data/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
File "<string>", line 173, in <module>
File "/home/www-data/web2py/gluon/sqlhtml.py", line 3435, in __init__
r = A(represent(field, r, record), _href=str(href))
File "/home/www-data/web2py/gluon/sqlhtml.py", line 79, in represent
return f(value)
File "/home/www-data/web2py/gluon/packages/dal/pydal/helpers/methods.py", line 287, in __call__
return value if value is None else _fieldformat(self.ref, value)
File "/home/www-data/web2py/gluon/packages/dal/pydal/helpers/methods.py", line 271, in _fieldformat
row = r(id)
File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 554, in __call__
orderby_on_limitby=False).first()
File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 2211, in select
return adapter.select(self.query, fields, attributes)
File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", line 760, in select

return self._select_aux(sql, fields, attributes, colnames
)
File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", line 716, in _select_aux
rows = self._select_aux_execute(sql)
File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", line 710, in _select_aux_execute
self.execute(sql)
File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/__init__.py", line 67, in wrap
return f(*args, **kwargs)
File "/home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py", line 410, in execute
rv = self.cursor.execute(command, *args[1:], **kwargs)
ProgrammingError: column gdt_config.fkEntbindungsdatum does not exist
LINE 1: ...fig"."gdtversion", "gdt_config"."gdtzeichensatz", "gdt_confi...
^

Error snapshot help

<class 'psycopg2.ProgrammingError'>(column gdt_config.fkEntbindungsdatum does not exist LINE 1: ...fig"."gdtversion", "gdt_config"."gdtzeichensatz", "gdt_confi... ^ )

Attribute inspizieren

Frames

  • File /home/www-data/web2py/gluon/restricted.py in restricted at line 219 code arguments Variablen

  • File /home/www-data/web2py/<string> in <module> at line 173 code arguments Variablen

  • File /home/www-data/web2py/gluon/sqlhtml.py in __init__ at line 3435 code arguments Variablen

  • File /home/www-data/web2py/gluon/sqlhtml.py in represent at line 79 code arguments Variablen

  • File /home/www-data/web2py/gluon/packages/dal/pydal/helpers/methods.py in __call__ at line 287 code arguments Variablen

  • File /home/www-data/web2py/gluon/packages/dal/pydal/helpers/methods.py in _fieldformat at line 271 code arguments Variablen

  • File /home/www-data/web2py/gluon/packages/dal/pydal/objects.py in __call__ at line 554 code arguments Variablen

  • File /home/www-data/web2py/gluon/packages/dal/pydal/objects.py in select at line 2211 code arguments Variablen

  • File /home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py in select at line 760 code arguments Variablen

  • File /home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py in _select_aux at line 716 code arguments Variablen

  • File /home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py in _select_aux_execute at line 710 code arguments Variablen

  • File /home/www-data/web2py/gluon/packages/dal/pydal/adapters/__init__.py in wrap at line 67 code arguments Variablen

  • File /home/www-data/web2py/gluon/packages/dal/pydal/adapters/base.py in execute at line 410 code arguments Variablen

    Function argument list

    (self=<pydal.adapters.postgres.PostgrePsyco object>, *args=('SELECT "gdt_config"."id", "gdt_config"."smbserve..." WHERE ("gdt_config"."id" = 2) LIMIT 1 OFFSET 0;',), **kwargs={})

    Code listing
    405.
    406.
    407.
    408.
    409.
    410.

    411.
    412.
    413.
    414.
        def execute(self, *args, **kwargs):
    command = self.filter_sql_command(args[0])
    handlers = self._build_handlers_for_execution()
    for handler in handlers:
    handler.before_execute(command)
    rv = self.cursor.execute(command, *args[1:], **kwargs)

    for handler in handlers:
    handler.after_execute(command)
    return rv
    Variables
    rv undefined
    self <pydal.adapters.postgres.PostgrePsyco object>
    args ('SELECT "gdt_config"."id", "gdt_config"."smbserve..." WHERE ("gdt_config"."id" = 2) LIMIT 1 OFFSET 0;',)
    self.cursor <cursor object at 0x679e6ad0; closed: 0>
    command 'SELECT "gdt_config"."id", "gdt_config"."smbserve..." WHERE ("gdt_config"."id" = 2) LIMIT 1 OFFSET 0;'
    self.cursor.execute <built-in method execute of psycopg2.extensions.cursor object>
    kwargs {}

The same db.py works perfectly with 2.14.6.

Not sure what is going on here.


Regards,

Oliver Holmes

Manuel Vio

unread,
Jul 31, 2017, 6:14:25 AM7/31/17
to web2py-users
Hi, I think I had the same problem, in my case it was a DAL constructor parameter changing its value in new web2py versions. Try to revert entity_quoting parameter to False as per this issue ticket I filed: https://github.com/web2py/web2py/issues/1697

See also here: http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Database-quoting-and-case-settings--entity_quoting--ignore_field-

Oliver Holmes

unread,
Jul 31, 2017, 10:43:35 AM7/31/17
to web2py-users
Yes, that did the trick! Thank you!

Cheers!
Oliver Holmes

wish...@gmail.com

unread,
Aug 4, 2017, 6:34:17 AM8/4/17
to web2py-users
>First issue with @mobilize import


Hey everybody,

I'm getting the same error with @mobilize after upgrade.
Any ideas how to resolve?

Thanks & cheers
Toby

wish...@gmail.com

unread,
Aug 6, 2017, 1:18:38 PM8/6/17
to web2py-users


On Thursday, 13 July 2017 09:45:11 UTC+2, Jacinto Parga wrote:
Reply all
Reply to author
Forward
0 new messages