[web2py] Re: redirect fails with only an error ticket from deep inside the framework

2017-08-07 Thread 'jim kaubisch' via web2py-users
Thanks, Anthony!!

That's good news. Please, what IS the right version number and where do I 
get it it? GitHub I would guess. Haven't had a chance to investigate yet

As for the eval choice, firstly I realize it may not be truly the best 
solution and I realize there are risks involved (eval), but its been a 
godsend to me.

As I was developing the app, I realized that I was writing basically the 
same code over and over and over, just with slight differences, e.g. the 
table name, the criteria, the fields I wanted to return and their display 
order...
so a couple of dictionaries to define (1) the tableviews criteria and (2) 
ordered list of fields to return and the core becomes a small 
parameterization of basically the same db query - 10s of lines of code.
Need a different view on the data? retrieve different fields? different 
order to the display of the data? A couple of minutes to add menu and 
dictionary entries and *no change of code* and you're there :)
Saved a LOT of duplicate code and effort.

BTW, what I'm developing is an INTERNAL web APP to manage thousands of 
media files and curricula activities in a non-technical environment 
(non-profit teaching ~25k kids music in elementary schools). Its NOT a 
webSITE.
So I guess I'm less a bit less concerned with the risks associated with 
eval than I might otherwise might be.


On Monday, August 7, 2017 at 4:29:30 PM UTC-7, jim kaubisch wrote:
>
> Hi,
>
> The following failure suddenly started in a piece of code thats been 
> running error free for months. I can think of nothing I’ve changed that 
> would cause this to happen (famous last words, I know).
> I've tried for hours to find something to explain this, without any 
> success 
> ANY ideas would be greatly appreciated. My hope is that people with a 
> deeper understanding of the web2py framework might have ideas..
>
> Thanks in advance!!
> Jim
> -
> The last moments of life are as follows..
>
> two variables, s and db_str,  are generated dynamically but end up having 
> values as follows...
>
> s= " 0)>"
> db_str = "s.select(db[media_table].id, db[media_table].name, 
> db[media_table].akaname, db[media_table].category)"
>
> try:
>session.media_list = eval(db_str)
> except Exception as e:
>logger.debug('This is what happened: %s' % e)
>raise
>
> logger.debug("redirecting...")
> redirect(URL('default', 'list_rows'))
>
> No exception thrown, 
> the debug message is displayed, 
> but it never gets to “list_rows” it seems (First line in list_rows is 
> another debug message
>
>
> instead, the following …
>
> Error ticket for "mfm_test"
> Ticket ID 
> 127.0.0.1.2017-08-07.15-22-39.88b049a9-c5f0-4b47-9aba-600839871461
> Version web2py™
> Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
>
> Traceback
> 1.Traceback (most recent call last):
> 2.  File "/Users/jimkaubisch 1/Dropbox 
> (MFM)/MfMCurrAdmin/Development/web2py/start/gluon/main.py", line 438, in 
> wsgibase
> 3.session.connect(request, response)
> 4. File "/Users/jimkaubisch 1/Dropbox 
> (MFM)/MfMCurrAdmin/Development/web2py/start/gluon/globals.py", line 965, in 
> connect
> 5.   session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL)
> 6. File "/Library/Python/2.7/site-packages/pydal/objects.py", line 2946, 
> in __getstate__
> 7.   del ret['fields']
> 8. KeyError: 'fields'
> 9.
>
> In file: Framework
> 1.
>
>

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


[web2py] Re: web2py 2.15.3 is OUT

2017-08-07 Thread 黄祥
problems from 2.15.1 still exist
1. Minify problems still exist
models/db.py
response.optimize_js = 'concat,minify,inline'

Access :
http://127.0.0.1:8000/test/appadmin/d3_graph_model

Return :
Traceback (most recent call last):
  File "/Users/MacBookPro/site/web2py/gluon/restricted.py", line 219, in 
restricted
exec(ccode, environment)
  File "", line 36, in 
  File "/Users/MacBookPro/site/web2py/gluon/globals.py", line 503, 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 498, in 
call_minify
self.optimize_js)
  File "/Users/MacBookPro/site/web2py/gluon/contrib/minify/minify.py", line 
111, in minify
contents = read_binary_file(abs_filename)
  File "/Users/MacBookPro/site/web2py/gluon/contrib/minify/minify.py", line 
32, in read_binary_file
f = open_py23(filename, 'r')
  File "/Users/MacBookPro/site/web2py/gluon/contrib/minify/minify.py", line 
26, in open_py23
f = open(filename, mode + 'b')
IOError: [Errno 2] No such file or directory: 
'/Users/MacBookPro/site/web2py/applications/mutualfunds/static/min.js'

2. before insert callback problem with required = True still exist

thanks and best regards,
stifan

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


[web2py] Re: redirect fails with only an error ticket from deep inside the framework

2017-08-07 Thread Anthony
Yes, going back to the correct version of pydal should fix this issue.

Why are you eval'ing DAL code rather than building the query using DAL 
objects?

On Monday, August 7, 2017 at 9:01:31 PM UTC-4, jim kaubisch wrote:
>
> Hi Anthony,
>
> Yes, indeed :( 
> In connection with my other post, I updated pydal in case my problem there 
> could be fixed by updating pydal to the latest version. Didn't realize :(
>
> I'm at a critical stage of my project so don't really want to upgrade to 
> the new web2py version right now. 
> I assume I can fix the issue by going back to the "correct" version of 
> pydal for 2.14.6? If its still available?
>
> Is there something I need to watch out for when I try?
>
> Thanks
>
>
> On Monday, August 7, 2017 at 4:29:30 PM UTC-7, jim kaubisch wrote:
>>
>> Hi,
>>
>> The following failure suddenly started in a piece of code thats been 
>> running error free for months. I can think of nothing I’ve changed that 
>> would cause this to happen (famous last words, I know).
>> I've tried for hours to find something to explain this, without any 
>> success 
>> ANY ideas would be greatly appreciated. My hope is that people with a 
>> deeper understanding of the web2py framework might have ideas..
>>
>> Thanks in advance!!
>> Jim
>> -
>> The last moments of life are as follows..
>>
>> two variables, s and db_str,  are generated dynamically but end up having 
>> values as follows...
>>
>> s= " 0)>"
>> db_str = "s.select(db[media_table].id, db[media_table].name, 
>> db[media_table].akaname, db[media_table].category)"
>>
>> try:
>>session.media_list = eval(db_str)
>> except Exception as e:
>>logger.debug('This is what happened: %s' % e)
>>raise
>>
>> logger.debug("redirecting...")
>> redirect(URL('default', 'list_rows'))
>>
>> No exception thrown, 
>> the debug message is displayed, 
>> but it never gets to “list_rows” it seems (First line in list_rows is 
>> another debug message
>>
>>
>> instead, the following …
>>
>> Error ticket for "mfm_test"
>> Ticket ID 
>> 127.0.0.1.2017-08-07.15-22-39.88b049a9-c5f0-4b47-9aba-600839871461
>> Version web2py™
>> Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
>>
>> Traceback
>> 1.Traceback (most recent call last):
>> 2.  File "/Users/jimkaubisch 1/Dropbox 
>> (MFM)/MfMCurrAdmin/Development/web2py/start/gluon/main.py", line 438, in 
>> wsgibase
>> 3.session.connect(request, response)
>> 4. File "/Users/jimkaubisch 1/Dropbox 
>> (MFM)/MfMCurrAdmin/Development/web2py/start/gluon/globals.py", line 965, in 
>> connect
>> 5.   session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL)
>> 6. File "/Library/Python/2.7/site-packages/pydal/objects.py", line 2946, 
>> in __getstate__
>> 7.   del ret['fields']
>> 8. KeyError: 'fields'
>> 9.
>>
>> In file: Framework
>> 1.
>>
>>

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


[web2py] Re: redirect fails with only an error ticket from deep inside the framework

2017-08-07 Thread 'jim kaubisch' via web2py-users
Hi Anthony,

Yes, indeed :( 
In connection with my other post, I updated pydal in case my problem there 
could be fixed by updating pydal to the latest version. Didn't realize :(

I'm at a critical stage of my project so don't really want to upgrade to 
the new web2py version right now. 
I assume I can fix the issue by going back to the "correct" version of 
pydal for 2.14.6? If its still available?

Is there something I need to watch out for when I try?

Thanks


On Monday, August 7, 2017 at 4:29:30 PM UTC-7, jim kaubisch wrote:
>
> Hi,
>
> The following failure suddenly started in a piece of code thats been 
> running error free for months. I can think of nothing I’ve changed that 
> would cause this to happen (famous last words, I know).
> I've tried for hours to find something to explain this, without any 
> success 
> ANY ideas would be greatly appreciated. My hope is that people with a 
> deeper understanding of the web2py framework might have ideas..
>
> Thanks in advance!!
> Jim
> -
> The last moments of life are as follows..
>
> two variables, s and db_str,  are generated dynamically but end up having 
> values as follows...
>
> s= " 0)>"
> db_str = "s.select(db[media_table].id, db[media_table].name, 
> db[media_table].akaname, db[media_table].category)"
>
> try:
>session.media_list = eval(db_str)
> except Exception as e:
>logger.debug('This is what happened: %s' % e)
>raise
>
> logger.debug("redirecting...")
> redirect(URL('default', 'list_rows'))
>
> No exception thrown, 
> the debug message is displayed, 
> but it never gets to “list_rows” it seems (First line in list_rows is 
> another debug message
>
>
> instead, the following …
>
> Error ticket for "mfm_test"
> Ticket ID 
> 127.0.0.1.2017-08-07.15-22-39.88b049a9-c5f0-4b47-9aba-600839871461
> Version web2py™
> Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
>
> Traceback
> 1.Traceback (most recent call last):
> 2.  File "/Users/jimkaubisch 1/Dropbox 
> (MFM)/MfMCurrAdmin/Development/web2py/start/gluon/main.py", line 438, in 
> wsgibase
> 3.session.connect(request, response)
> 4. File "/Users/jimkaubisch 1/Dropbox 
> (MFM)/MfMCurrAdmin/Development/web2py/start/gluon/globals.py", line 965, in 
> connect
> 5.   session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL)
> 6. File "/Library/Python/2.7/site-packages/pydal/objects.py", line 2946, 
> in __getstate__
> 7.   del ret['fields']
> 8. KeyError: 'fields'
> 9.
>
> In file: Framework
> 1.
>
>

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


[web2py] Re: web2py 2.15.3 is OUT

2017-08-07 Thread 黄祥
test the new version (web2py_src.zip) with the same code that work in 
previous version (2.15.2) got an error :

Internal errorTicket issued: unknown 


step i took :
cd
rm -rf ~/web2py/applications/test
cp -R ~/web2py/applications/welcome/ ~/web2py/applications/test
rsync -zavr ~/Programming/Python/Web2py/test ~/web2py/applications/
rsync -zavur ~/Programming/Python/Web2py/test ~/web2py/applications/

thanks and best regards,
stifan

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


[web2py] Problem with Grid Exporter since upgrade from 2.14.6 to 2.15.2 / 2.15.3

2017-08-07 Thread Simon Riek
Since updating from 2.14.6 to 2.15.2 (and also 2.15.3 released just moments 
ago) I have some problems with the default ExportClasses in SQLFORM.grid.
I am using MSSQL as database.
The grid displays just fine, only the export failed.

I'll spare you the complete traceback and get directly to what I could find 
by implementing my own ExportClass.

At first I got a , the relevant traceback 
was:

File "C:\Users\riek\PycharmProjects\web2py\gluon\sqlhtml.py", line 3563, in 
represented
row.append(record._extra[col])

I didn't use any type _extra fields, meaning that the regex check in line 
3562 failed (self.rows.db._adapter.REGEX_TABLE_DOT_FIELD.match(col)).

I then overwrote the "represented"-Function with my own, ignoring this 
check and forcing the else-branch. 

This lead to the following exception:  
'DAL' object has no attribute '"t_schule"'. So my tables and fields are 
escaped and thus not found.

I tried a solution I found somewhere else, setting entity_quoting=False in 
my DAL-instance, to no avail.

I then searched some more and found this bugfix: 
https://github.com/web2py/web2py/issues/1542
It appears that this fix escapes the tables and fields, no matter 
if entity_quoting is enabled or not.

I could solve my particular problem with an ugly hack, by removing the 
quotes in the represent-function of my ExportClass (line 3565 in 
sqlhtml.py: *(t, f) = col.replace('"','').split('.') * instead of *(t, f) = 
col.split('.')) *
I am wondering though if this is a bug or I am not properly understanding 
how the escaping works.




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


[web2py] Re: redirect fails with only an error ticket from deep inside the framework

2017-08-07 Thread Anthony
Did you somehow update pydal without updating web2py? The version of pydal 
you are running is not the one associated with web2py 2.14.6 (you have a 
more recent version of pydal).

Anthony

On Monday, August 7, 2017 at 7:29:30 PM UTC-4, jim kaubisch wrote:
>
> Hi,
>
> The following failure suddenly started in a piece of code thats been 
> running error free for months. I can think of nothing I’ve changed that 
> would cause this to happen (famous last words, I know).
> I've tried for hours to find something to explain this, without any 
> success 
> ANY ideas would be greatly appreciated. My hope is that people with a 
> deeper understanding of the web2py framework might have ideas..
>
> Thanks in advance!!
> Jim
> -
> The last moments of life are as follows..
>
> two variables, s and db_str,  are generated dynamically but end up having 
> values as follows...
>
> s= " 0)>"
> db_str = "s.select(db[media_table].id, db[media_table].name, 
> db[media_table].akaname, db[media_table].category)"
>
> try:
>session.media_list = eval(db_str)
> except Exception as e:
>logger.debug('This is what happened: %s' % e)
>raise
>
> logger.debug("redirecting...")
> redirect(URL('default', 'list_rows'))
>
> No exception thrown, 
> the debug message is displayed, 
> but it never gets to “list_rows” it seems (First line in list_rows is 
> another debug message
>
>
> instead, the following …
>
> Error ticket for "mfm_test"
> Ticket ID 
> 127.0.0.1.2017-08-07.15-22-39.88b049a9-c5f0-4b47-9aba-600839871461
> Version web2py™
> Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
>
> Traceback
> 1.Traceback (most recent call last):
> 2.  File "/Users/jimkaubisch 1/Dropbox 
> (MFM)/MfMCurrAdmin/Development/web2py/start/gluon/main.py", line 438, in 
> wsgibase
> 3.session.connect(request, response)
> 4. File "/Users/jimkaubisch 1/Dropbox 
> (MFM)/MfMCurrAdmin/Development/web2py/start/gluon/globals.py", line 965, in 
> connect
> 5.   session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL)
> 6. File "/Library/Python/2.7/site-packages/pydal/objects.py", line 2946, 
> in __getstate__
> 7.   del ret['fields']
> 8. KeyError: 'fields'
> 9.
>
> In file: Framework
> 1.
>
>

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


[web2py] redirect fails with only an error ticket from deep inside the framework

2017-08-07 Thread 'jim kaubisch' via web2py-users
Hi,

The following failure suddenly started in a piece of code thats been 
running error free for months. I can think of nothing I’ve changed that 
would cause this to happen (famous last words, I know).
I've tried for hours to find something to explain this, without any success 
ANY ideas would be greatly appreciated. My hope is that people with a 
deeper understanding of the web2py framework might have ideas..

Thanks in advance!!
Jim
-
The last moments of life are as follows..

two variables, s and db_str,  are generated dynamically but end up having 
values as follows...

s= " 0)>"
db_str = "s.select(db[media_table].id, db[media_table].name, 
db[media_table].akaname, db[media_table].category)"

try:
   session.media_list = eval(db_str)
except Exception as e:
   logger.debug('This is what happened: %s' % e)
   raise

logger.debug("redirecting...")
redirect(URL('default', 'list_rows'))

No exception thrown, 
the debug message is displayed, 
but it never gets to “list_rows” it seems (First line in list_rows is 
another debug message


instead, the following …

Error ticket for "mfm_test"
Ticket ID 127.0.0.1.2017-08-07.15-22-39.88b049a9-c5f0-4b47-9aba-600839871461
Version web2py™
Version 2.14.6-stable+timestamp.2016.05.10.00.21.47

Traceback
1.Traceback (most recent call last):
2.  File "/Users/jimkaubisch 1/Dropbox 
(MFM)/MfMCurrAdmin/Development/web2py/start/gluon/main.py", line 438, in 
wsgibase
3.session.connect(request, response)
4. File "/Users/jimkaubisch 1/Dropbox 
(MFM)/MfMCurrAdmin/Development/web2py/start/gluon/globals.py", line 965, in 
connect
5.   session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL)
6. File "/Library/Python/2.7/site-packages/pydal/objects.py", line 2946, in 
__getstate__
7.   del ret['fields']
8. KeyError: 'fields'
9.

In file: Framework
1.

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


[web2py] Re: Insecure string Pickle with web2py 2.15.2

2017-08-07 Thread Leonel Câmara
Seth it seems like you did a fake_migrate after setting username=True in 
auth.define_tables. So the username column is not there and the .table file 
says it is.  
  
Set username=False. Do a fake_migrate. Turn fake_migrate=False. Set 
username=True. This will create the column.

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


[web2py] Re: Insecure string Pickle with web2py 2.15.2

2017-08-07 Thread Seth J
It is Sqlite3 and after following directions in this post to solve the 
"pickle issue" I get the following error with username table.  Am I missing 
something?

 no such column: auth_user.usernameVersion
web2py™ Version 2.15.3-stable+timestamp.2017.08.07.12.51.45
Python Python 2.7.10: C:\Python27\python.exe (prefix: C:\Python27)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.

Traceback (most recent call last):
  File ".\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
  File "C:/inetpub/wwwroot/applications/PEDchangeLog/controllers/default.py" 
,
 line 90, in 
  File ".\gluon\globals.py", line 409, in 
self._caller = lambda f: f()
  File "C:/inetpub/wwwroot/applications/PEDchangeLog/controllers/default.py" 
,
 line 41, in user
return dict(form=auth())
  File ".\gluon\tools.py", line 1925, in __call__
return getattr(self, args[0])()
  File ".\gluon\tools.py", line 2704, in login
user = table_user(**{username: entered_username})
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\objects.py", line 566, in 
__call__
orderby_on_limitby=False).first()
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\objects.py", line 2211, in 
select
return adapter.select(self.query, fields, attributes)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\sqlite.py", line 
82, in select
return super(SQLite, self).select(query, fields, attributes)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\base.py", line 
762, in select
return self._select_aux(sql, fields, attributes, colnames)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\base.py", line 
718, in _select_aux
rows = self._select_aux_execute(sql)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\base.py", line 
712, in _select_aux_execute
self.execute(sql)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\__init__.py", line 
67, in wrap
return f(*args, **kwargs)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\adapters\base.py", line 
412, in execute
rv = self.cursor.execute(command, *args[1:], **kwargs)
OperationalError: no such column: auth_user.username

Error snapshot [image: help] 


(no such column: auth_user.username)

On Monday, August 7, 2017 at 4:31:22 PM UTC-4, Dave S wrote:
>
>
>
> On Monday, August 7, 2017 at 1:08:47 PM UTC-7, Seth J wrote:
>>
>> So, the data in those tables is permanently gone?!
>>
>
> No, no ... "table files" describes the METADATA that PyDal uses to 
> interface with the Data Base Engine.  Unless you're using Sqlite3, the 
> actual data isn't even in the application directory, and (for production) 
> not even on the same machine.
>  
> /dps
>
>
>
>> On Friday, August 4, 2017 at 12:15:29 PM UTC-4, Leonel Câmara wrote:
>>>
>>> This is weird I would just move all table files to a backup migration 
>>> and do a fake migration to recreate them and see if it solves the problem.
>>>
>>

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


[web2py] Re: Insecure string Pickle with web2py 2.15.2

2017-08-07 Thread Dave S


On Monday, August 7, 2017 at 1:08:47 PM UTC-7, Seth J wrote:
>
> So, the data in those tables is permanently gone?!
>

No, no ... "table files" describes the METADATA that PyDal uses to 
interface with the Data Base Engine.  Unless you're using Sqlite3, the 
actual data isn't even in the application directory, and (for production) 
not even on the same machine.
 
/dps



> On Friday, August 4, 2017 at 12:15:29 PM UTC-4, Leonel Câmara wrote:
>>
>> This is weird I would just move all table files to a backup migration and 
>> do a fake migration to recreate them and see if it solves the problem.
>>
>

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


[web2py] Re: Insecure string Pickle with web2py 2.15.2

2017-08-07 Thread Seth J
So, the data in those tables is permanently gone?!

On Friday, August 4, 2017 at 12:15:29 PM UTC-4, Leonel Câmara wrote:
>
> This is weird I would just move all table files to a backup migration and 
> do a fake migration to recreate them and see if it solves the problem.
>

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


[web2py] web2py 2.15.3 is OUT

2017-08-07 Thread Massimo Di Pierro
Contains lots of small fixes. 
Many thanks to Leonel for taking care of many urgent issues in a hurry.

\
Massimo

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


[web2py] Re: paired fields in web2py

2017-08-07 Thread Massimo Di Pierro
You can use SQLFORM.factory but I recommend something like vue, ractive, or 
angular. In in the end it makes things simpler.


On Monday, 7 August 2017 01:01:05 UTC-5, Mumtoz Dalimov wrote:
>
> Thanks a lot, Massimo.
> I understood the structure of the model. 
>
> Any ideas how to make convenient input of data in the View. 
> Should inputter remember invoice.id each time he inputs invoice_item to 
> get invoice_items grouped?
> Maybe I better use SQLFORM.factory to get 2 tables populated at once? And 
> how then get one list field (QUANTITY) multiplied when another(PRODUCT)  is 
> multiplied?
>
>
>

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


[web2py] Re: Weird problems generating menu from database

2017-08-07 Thread Massimo Di Pierro
So I think...

db = DAL('sqlite://storage.sqlite')

db.define_table('map',Field('menu1'),Field('menu2'),Field('mnm_name'),Field(
'link'))


import collections

def build_menu():

m1, m2 = [], [] # to preserve orders   
   

m = collections.defaultdict(lambda: collections.defaultdict(list))

for row in db(db.map).select(orderby=db.map.menu1|db.map.menu2):

if not row.menu1 in m1: m1.append(row.menu1)

if not row.menu2 in m2: m2.append(row.menu2)

m[row.menu1][row.menu2].append((row.mnm_name, row.link))

menu = []

for a in m1:

submenu = []

menu.append([a, None, None, submenu])

for b, items in m[a].items():

subsubmenu = [[key, None, link] for key, link in items]

submenu.append([b, None, None, subsubmenu])

return menu


response.menu = cache.ram('menu', lambda:build_menu(), None) # to cache it!



On Sunday, 6 August 2017 04:31:00 UTC-5, Вячеслав Анатольевич wrote:
>
> Thanks, Massimo!
> So, i have a database table - named "map", in that table - three field - 
> menu1, menu2, mnm_name.
> Menu mast be like that:
> 
>- menu1
> - menu2
>   -mnm_name
> In menu1 - menu2, in menu2 - mnm_name
>

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


[web2py] Re: Error in appadmin (database admin) on python 3

2017-08-07 Thread Massimo Di Pierro
please open a ticket in web2py or pydal, I can fix this in either place.

On Sunday, 6 August 2017 10:07:40 UTC-5, Kirill Shatalaev wrote:
>
> Hello, when using python3 and database admin, I got this error:
>
>  name 'unicode' is not defined
>
> You need to click on any table name (for example, 
> http://127.0.0.1:8000/welcome/appadmin/select/db?query=db.auth_user.id%3E0
> ).
>
> I think this is python3 unicode -> str specific related trouble.
>
>
>
>

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


[web2py] Re: admin password in web2py docker not correct

2017-08-07 Thread Massimo Di Pierro
I think your first proposed fix is better. the change in gluon/main.py 
should not be needed. It should not be completely impossible to have a " " 
in a password.

On Saturday, 5 August 2017 11:44:46 UTC-5, JaapP wrote:
>
> Hi,
>
> Hope to save someone with the same problem some time:
>
> i encountered a problem running web2py in a docker; the admin password as 
> set from the start command was not recognised when trying to log into the 
> admin interface.
>
> Wrong dockerfile snippet:
>
> EXPOSE 8000
> CMD ["/usr/bin/python", "/home/web2py/web2py.py", "-i 0.0.0.0", "-p 8000", 
> "-a 
> admin"]
>
>
> web2py thinks (sees) the admin password being ' admin' (space in front of 
> the password).
>
> What *does* work: 
>
> EXPOSE 8000
> CMD ["/usr/bin/python", "/home/web2py/web2py.py", "-i 0.0.0.0", "-p 8000", 
> "-a","admin"]
>
>
>
> If acceptable, this problem could also be solved by changing save_password 
> in gluon/main.py:
>
> else:
> # use provided password
> cpassword = CRYPT()(password.strip(' '))[0]
>
>
>
> Best regards,
>
> Jaap
>
>

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


[web2py] Re: Unable to start web2py 2.15.2 with ssl

2017-08-07 Thread Massimo Di Pierro
Included the fix in 2.15.3 but please check it in case I got it wrong.

On Friday, 4 August 2017 11:18:45 UTC-5, José Leite wrote:
>
> Thanks, just submitted the issue.
>
> sexta-feira, 4 de Agosto de 2017 às 16:58:14 UTC+1, Leonel Câmara escreveu:
>>
>> Still, probably a bug if it still doesn't work with the has_ssl change, 
>> submit an issue.
>>
>

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


[web2py] Re: MS-SQL DAL Problem ( connecting is ok )

2017-08-07 Thread Massimo Di Pierro
Thanks for reporting this. Included in 2.15.3

On Friday, 4 August 2017 16:33:37 UTC-5, Razvan Cristian wrote:
>
> Good evening!
>
> Yes, the fix worked! Yuhu!!! 
> Thank you very much for your fast fix and reply.
>
> Have a nice weekend!
>
> On Friday, August 4, 2017 at 6:18:58 PM UTC+3, Massimo Di Pierro wrote:
>>
>> I committed a fix to pysql just now. Can you check it fixes the problem 
>> for you?
>>
>> On Thursday, 3 August 2017 16:57:45 UTC-5, Razvan Cristian wrote:
>>>
>>>
>>> Hello all!
>>>
>>> I am in the process of learning web2py. I downloaded the binaries and 
>>> the sources for windows and give it a run but i encountered a problem.
>>>
>>> When i try to create a new user ( from welcome app )  i get the 
>>> following error : 
>>>
>>> " File "d:\web2py_surse\web2py\gluon\contrib\pypyodbc.py", line 954, in 
>>> ctrl_err
>>> raise ProgrammingError(state,err_text)
>>> ProgrammingError: (u'42000', u"[42000] [Microsoft][ODBC SQL Server 
>>> Driver][SQL Server]Incorrect syntax near the keyword 'TOP'.") "  visual 
>>> studio debugger output
>>>
>>> and from sql profiler i see that the DAL generates the following sql : 
>>> "SELECT "auth_user"."id", "auth_user"."email" FROM "auth_user" WHERE 
>>> ("auth_user"."email" = 'christia...@gmail.com') TOP 1;"  which it is 
>>> not correct , it should be   "SELECT  TOP 1 "auth_user"."id", 
>>> "auth_user"."email" FROM "auth_user" WHERE ("auth_user"."email" = '
>>> christia...@gmail.com') ;"
>>>
>>> I browsed a while through sources but can't find where the query is 
>>> generated...( still learning the web2py code :) )
>>>
>>> Any ideas? 
>>>
>>> PS: the error occurs even if i run from the binaries.
>>>
>>> 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: SQLFORM.grid search type error reduce()

2017-08-07 Thread Paul Ellis
I will gladly test. But I can't do it until next week. 

⁣Sent from TypeApp ​

On 4 Aug. 2017, 17:58, at 17:58, Massimo Di Pierro  
wrote:
>Just fixed in trunk. Can you please help test the fix?
>
>On Tuesday, 1 August 2017 03:46:13 UTC-5, Paul Ellis wrote:
>>
>> I am getting this error only when searching the auth_membership table
>>
>> I have put in a basic 'appadmin' in my webapp. I call it 'tooladmin'
>to 
>> differentiate from the built in stuff.
>>
>> I use this function to edit any database table:
>> def manage_table():
>> tablename = request.args(0)
>> pagetitle = H4('{0} {1}'.format(T('Manage'), tablename))
>> buttongroup = [_btn_index()]
>> table = db[tablename]
>> pagecontent = SQLFORM.grid(table, args=[request.args(0)])
>>
>>
>> response.view = 'tooladmin_core.html'
>> return dict(pagetitle=pagetitle, buttongroup=buttongroup, 
>> pagecontent=pagecontent)
>>
>> The search feature on the SQLFORM.grid is throwing this error when 
>> searching the auth_membership table:
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>>
>> Traceback (most recent call last):
>>   File "E:\web2py\gluon\restricted.py", line 227, in restricted
>> exec ccode in environment
>>   File "E:/web2py/applications/OfferTool/controllers/tooladmin.py"
>,
>line 262, in 
>>   File "E:\web2py\gluon\globals.py", line 417, in 
>> self._caller = lambda f: f()
>>   File "E:/web2py/applications/OfferTool/controllers/tooladmin.py"
>,
>line 136, in manage_table
>> pagecontent = SQLFORM.grid(table, args=[request.args(0)])
>>   File "E:\web2py\gluon\sqlhtml.py", line 2526, in grid
>> subquery = SQLFORM.build_query(sfields, keywords)
>>   File "E:\web2py\gluon\sqlhtml.py", line 1827, in build_query
>> ) for k in key.split()])
>> TypeError: reduce() of empty sequence with no initial value
>>
>>
>>
>>
>
>-- 
>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 a topic in the
>Google Groups "web2py-users" group.
>To unsubscribe from this topic, visit
>https://groups.google.com/d/topic/web2py/UnN6AyOh2Lg/unsubscribe.
>To unsubscribe from this group and all its topics, send an email to
>web2py+unsubscr...@googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

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


[web2py] CAS in case of existing applications

2017-08-07 Thread 'Annet' via web2py-users

I have one application (adminmodel) containing models, modules and static 
files and three other applications
using these models, modules and static files. Two of the three applications 
have been developed
independently of each other, and have their own register and login 
functions. All applications connect to
the same database.

I want to use CAS to switch to single sign on.

My problem is that the auth_cas table has not been created, how do I force 
web2py to create it?

Is it possible to have all auth_ tables defined in the adminmodel 
application and have a separate
casprovider application?

When a user logs in or out I have functions that take care of some settings 
that I store in session,
I also use the auth object in both client applications, will this still 
work with CAS?


Best regards,

Annet 

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


[web2py] Re: Weird problems generating menu from database

2017-08-07 Thread Вячеслав Анатольевич

>
> In Wiki menus:
>
- Home > @index

- Info > @info
- web2py > http://www.web2py.com
- - About us > @aboutus 

- - - Contact us > @contactus  -  If I add a third minus - THIS NOT WORKED!


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


[web2py] Re: paired fields in web2py

2017-08-07 Thread 'Mumtoz Dalimov' via web2py-users
Thanks a lot, Massimo.
I understood the structure of the model. 

Any ideas how to make convenient input of data in the View. 
Should inputter remember invoice.id each time he inputs invoice_item to get 
invoice_items grouped?
Maybe I better use SQLFORM.factory to get 2 tables populated at once? And 
how then get one list field multiplied when another is multiplied?


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