Hallo Massimo,
There is a problem with sorting of model subfolders in 2.7.2. We made some
> changes in trunk.
>
After this morning's updates from the trunk I got problems for the first
time which reflected a sorting problem:
Traceback (most recent call last):
File "/home/js/web2py/gluon/restricted.py", line 217, in restricted
exec ccode in environment
File "/home/js/web2py/applications/nkb/models/akb/akb.py", line 22,
in <module>
db.executesql("set search_path to akb, public;")
NameError: name 'db' is not defined
And my models directory:
-rw-r--r-- 1 js js 1196 Okt 11 07:43 0.py
-rw-r--r-- 1 js js 1354 Okt 10 23:02 0.py.orig
drwxr-xr-x 2 js js 4096 Okt 8 14:44 akb
-rw-r--r-- 1 js js 7845 Okt 11 07:44 dbcommon.py
-rw-r--r-- 1 js js 7994 Okt 10 23:13 dbcommon.py.orig
-rw-r--r-- 1 js js 9459 Okt 11 07:44 db.py
-rw-r--r-- 1 js js 9504 Okt 10 23:07 db.py.orig
drwxr-xr-x 2 js js 4096 Okt 21 10:41 isi
-rw-r--r-- 1 js js 11652 Okt 8 14:44 menu.py
-rw-r--r-- 1 js js 10060 Aug 29 09:30 menu.py.orig
drwxr-xr-x 2 js js 4096 Okt 8 14:44 sabinet
Please help me check that:
>
> [ ] if you have a byte-compiled app, it still runs fine
> [ ] if you byte-compiler an app with trunk, it runs fine
> [ ] models are executed in this order:
> models/*.py (alphabetically) then
> models/<controller>*.py(alphabetically) then
> models/<controller>/<function>/*.py (also alphabetically)
> [ ] if you set response.models_to_run (described in the book) the filter
> works correctly for normal apps and byte code compiled apps.
>
> None of the above worked for me.
> I have tried the following in 0.py but it did not solve the problem:
response.models_to_run = [
r'^\0\.py$',
r'^\db\.py$',
r'^\dbcommon\.py$',
r'^%s/\w+\.py$' % request.controller,
r'^%s/%s/\w+\.py$' % (request.controller, request.function)
]
In the end I go the app working again by doing:
> hg rename db.py 0db.py
> hg rename dbcommon.py 0dbcommon.py
Regards
Johann
--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.