web2py 2.15.2 is OUT

271 views
Skip to first unread message

Massimo Di Pierro

unread,
Jul 19, 2017, 8:25:52 AM7/19/17
to web2py-users
web2py 2.15.2 is OUT is includes a few major bug fixes to version 2.15.1. Thanks Leonel for the quick fixes.
There a few other outstanding problems and they will be resolved in the next week.

For new users 2.15.2 is still better than previous versions. For current users, please check it out and continue to report any problem. We want to make sure it is backward compatible as promised.

Massimo

BearXu

unread,
Jul 19, 2017, 10:13:58 AM7/19/17
to web...@googlegroups.com
Thanks

--
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.

黄祥

unread,
Jul 19, 2017, 6:00:52 PM7/19/17
to web2py-users
found an error that the same code didn't throw an error in previous version 2.15.1

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/models/db_schema_0_auth.py", line 7, in <module>
    custom_auth_table = db[auth.settings.table_user_name]
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/base.py", line 663, in __getitem__
    return self.__getattr__(str(key))
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/base.py", line 669, in __getattr__
    return self.lazy_define_table(tablename, *fields, **args)
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/base.py", line 596, in lazy_define_table
    fields = list(fields) + [f.clone() for f in common_fields]
AttributeError: 'Table' object has no attribute 'clone'

thanks and best regards,
stifan


Leonel Câmara

unread,
Jul 20, 2017, 8:39:17 AM7/20/17
to web2py-users
Stifan that error is caused because you're putting a Table in common_fields. Which I didn't expect. I'll fix it.

Leonel Câmara

unread,
Jul 20, 2017, 9:08:32 AM7/20/17
to web2py-users
@stifan here's the fix if you want to apply it on your running code before the new version comes out

黄祥

unread,
Jul 20, 2017, 6:32:45 PM7/20/17
to web2py-users
found another error that the same code run well in previous version (different from reported before)

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/models/db_schema_0_auth.py", line 7, in <module>
    custom_auth_table = db[auth.settings.table_user_name]
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/base.py", line 663, in __getitem__
    return self.__getattr__(str(key))
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/base.py", line 669, in __getattr__
    return self.lazy_define_table(tablename, *fields, **args)
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/base.py", line 621, in lazy_define_table
    polymodel=polymodel)
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/adapters/base.py", line 795, in create_table
    return self.migrator.create_table(*args, **kwargs)
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/migrator.py", line 277, in create_table
    self.adapter.create_sequence_and_triggers(query, table)
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/adapters/base.py", line 878, in create_sequence_and_triggers
    self.execute(query)
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/adapters/__init__.py", line 67, in wrap
    return f(*args, **kwargs)
  File "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/adapters/base.py", line 410, in execute
    rv = self.cursor.execute(command, *args[1:], **kwargs)
OperationalError: table "auth_user" already exists

step i took for testing from git
terminal 1
cd ~/git/web2py
git remote -v
git fetch upstream
git checkout master
git merge upstream/master
mv ~/site/web2py ~/site/web2py_latest
cp ~/git/web2py ~/site/
source ~/site/bin/activate
python ~/site/web2py/web2py.py --nogui --no-banner -a 'a' -i 0.0.0.0 -p 8000

terminal 2
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/

Leonel Câmara

unread,
Jul 20, 2017, 7:53:27 PM7/20/17
to web2py-users
@stifan seems like you need a fake migrate to fix your table files.

黄祥

unread,
Jul 20, 2017, 9:36:57 PM7/20/17
to web2py-users
yes, you are right, fake_migrate_all=True in db.py fixed the auth_user table exist's problem and the clone problem didn't appear again

tim.n...@conted.ox.ac.uk

unread,
Jul 21, 2017, 4:35:34 AM7/21/17
to web...@googlegroups.com
Creating a SQLFORM.factory() from tables, or a combination of tables and fields, now breaks, because the underlying logic assumes the tables are fields:

form = SQLFORM.factory(idb.catering, idb.catering_diet)

File "/home/www-data/internal-apps/gluon/sqlhtml.py", line 1922, in factory
return SQLFORM(DAL(None).define_table(table_name, *[field.clone() for field in fields]),
AttributeError: 'Table' object has no attribute 'clone'

tim.n...@conted.ox.ac.uk

unread,
Jul 21, 2017, 4:42:09 AM7/21/17
to web2py-users
Actually, this should be simple enough that I can post a fix.

Massimo Di Pierro

unread,
Jul 22, 2017, 4:36:47 PM7/22/17
to web2py-users
Thank you Tim.
Reply all
Reply to author
Forward
0 new messages