Re: [web2py] Re: insecure string pickle

2017-09-06 Thread Kiran Subbaraman
You should clear out the following files - sessions / errors / cache 
content - from your 2.9.11 based application



Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On 06-Sep-17 10:26 AM, Wabbajack wrote:

Hi I also go this Error...

I am running Win7 computer
I used web2py 2.9.11 when i created an app before
with database and etc.

Now i have new applications running 2.14.6 with no problem also...

But when i copied the old application created on my previous 
web2py<2.9.11>

into web2py<2.14.6> to pack it all up in one running web2py

then i got this error specific to applications created on 2.9.11

I thought it is back compatible with the newer releases...

Thanks,
Jak



On Tuesday, February 3, 2015 at 12:43:41 PM UTC+8, Dmitry Ermolaev wrote:


Error ticket for "admin"


  Ticket ID

127.0.0.1.2015-02-03.07-40-32.4dc31e25-5b8c-4c78-b525-2a58b4ff7015


 insecure string pickle


  Версия

web2py™ Version 2.9.12-stable+timestamp.2015.01.17.06.11.03
Python  Python 2.7.6: C:\Python27\python.exe (prefix: C:\Python27)


  Traceback

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



Traceback(most recent call last): File"C:\web2py-m\gluon\restricted.py", 
line224, in restricted
 exec ccodein environment
   
File"C:/web2py-m/applications/admin\compiled\controllers.default.errors.py
", line1945, in  
File"C:\web2py-m\gluon\globals.py", line393, in  self._caller= lambda f: f() 
File"C:/web2py-m/applications/admin\compiled\controllers.default.errors.py
", line1554, in errors
   File"C:\Python27\lib\pickle.py", line1378, in load
 return Unpickler(file).load() File"C:\Python27\lib\pickle.py", 
line858, in load
 dispatch[key](self) File"C:\Python27\lib\pickle.py", line966, in 
load_string
 raise ValueError, "insecure string pickle" ValueError: insecure string 
pickle


  Error snapshot help
  


|(insecure string pickle)|

inspect attributes


Frames

 *

*File C:\web2py-m\gluon\restricted.py in restricted at line
224* код аргументы переменные

 *

*File
C:\web2py-m\applications\admin\compiled\controllers.default.errors.py
 in  at line
1945* код аргументы переменные

 *

*File C:\web2py-m\gluon\globals.py in  at line 393*
код аргументы переменные

 *

*File
C:\web2py-m\applications\admin\compiled\controllers.default.errors.py
 in errors at line 1554*
код аргументы переменные

 *

*File C:\Python27\lib\pickle.py in load at line 1378* код
аргументы переменные

 *

*File C:\Python27\lib\pickle.py in load at line 858* код
аргументы переменные

 *

*File C:\Python27\lib\pickle.py in load_string at line 966*
код аргументы переменные


  Function argument list

(self=)


  Code listing

961.
962.
963.
964.
965.
966.

967.
968.
969.
970.



 def load_string(self): rep= self.readline()[:-1] for qin "\"'": # 
double or single quote if rep.startswith(q): if len(rep) < 2 or not rep.endswith(q):
raise ValueError, "insecure string pickle"
rep= rep[len(q):-len(q)] break else: raise ValueError, "insecure string 
pickle"


  Variables

builtinValueError   


Context

locals request session response


  In file:
  C:\web2py-m\applications\admin\compiled\controllers.default.errors.pyc

1.



 at072EADA0, 
file"C:/web2py-m/applications/admin\compiled\controllers.default.errors.py
", line3>

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


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

Re: [web2py] Re: insecure string pickle

2017-09-06 Thread Wabbajack
Hi Kiran,

Yes the folders cache, sessions, and error have no file inside...
Is there any other way to clear this folders? 
I just manually delete all files in each folder..
and also i have tried restarting the web2py itself 

Still the error exist 

Thanks,
Jak

On Wednesday, September 6, 2017 at 3:11:36 PM UTC+8, Kiran Subbaraman wrote:
>
> You should clear out the following files - sessions / errors / cache 
> content - from your 2.9.11 based application
>
> 
> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>
> On 06-Sep-17 10:26 AM, Wabbajack wrote:
>
> Hi I also go this Error...
>
> I am running Win7 computer
> I used web2py 2.9.11 when i created an app before
> with database and etc.
>
> Now i have new applications running 2.14.6 with no problem also...
>
> But when i copied the old application created on my previous web2py<2.9.11>
> into web2py<2.14.6> to pack it all up in one running web2py
>
> then i got this error specific to applications created on 2.9.11
>
> I thought it is back compatible with the newer releases...
>
> Thanks,
> Jak
>
>
>
> On Tuesday, February 3, 2015 at 12:43:41 PM UTC+8, Dmitry Ermolaev wrote: 
>>
>> Error ticket for "admin" Ticket ID 
>>
>> 127.0.0.1.2015-02-03.07-40-32.4dc31e25-5b8c-4c78-b525-2a58b4ff7015
>>  insecure string pickle Версия 
>> web2py™ Version 2.9.12-stable+timestamp.2015.01.17.06.11.03 
>> Python Python 2.7.6: C:\Python27\python.exe (prefix: C:\Python27) 
>> Traceback 
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>>
>> Traceback (most recent call last):
>>   File "C:\web2py-m\gluon\restricted.py", line 224, in restricted
>> exec ccode in environment
>>   File 
>> "C:/web2py-m/applications/admin\compiled\controllers.default.errors.py", 
>> line 1945, in 
>>   File "C:\web2py-m\gluon\globals.py", line 393, in 
>> self._caller = lambda f: f()
>>   File 
>> "C:/web2py-m/applications/admin\compiled\controllers.default.errors.py", 
>> line 1554, in errors
>>   File "C:\Python27\lib\pickle.py", line 1378, in load
>> return Unpickler(file).load()
>>   File "C:\Python27\lib\pickle.py", line 858, in load
>> dispatch[key](self)
>>   File "C:\Python27\lib\pickle.py", line 966, in load_string
>> raise ValueError, "insecure string pickle"ValueError: insecure string 
>> pickle
>>
>> Error snapshot [image: help] 
>> 
>>  
>>
>> (insecure string pickle)
>>
>> inspect attributes
>> Frames 
>>
>>- 
>>
>>*File C:\web2py-m\gluon\restricted.py in restricted at line 224* код 
>>аргументы переменные
>>- 
>>
>>*File 
>>C:\web2py-m\applications\admin\compiled\controllers.default.errors.py 
>> in  at line 1945* код 
>>аргументы переменные
>>- 
>>
>>*File C:\web2py-m\gluon\globals.py in  at line 393* код 
>>аргументы переменные
>>- 
>>
>>*File 
>>C:\web2py-m\applications\admin\compiled\controllers.default.errors.py 
>> in errors at line 1554* код 
>>аргументы переменные
>>- 
>>
>>*File C:\Python27\lib\pickle.py in load at line 1378* код аргументы 
>>переменные
>>- 
>>
>>*File C:\Python27\lib\pickle.py in load at line 858* код аргументы 
>>переменные
>>- 
>>
>>*File C:\Python27\lib\pickle.py in load_string at line 966* код 
>>аргументы переменные
>>Function argument list 
>>
>>(self=)
>>Code listing 
>>
>>961.
>>962.
>>963.
>>964.
>>965.
>>966.
>>
>>967.
>>968.
>>969.
>>970.
>>
>>def load_string(self):
>>rep = self.readline()[:-1]
>>for q in "\"'": # double or single quote
>>if rep.startswith(q):
>>if len(rep) < 2 or not rep.endswith(q):
>>raise ValueError, "insecure string pickle"
>>
>>rep = rep[len(q):-len(q)]
>>break
>>else:
>>raise ValueError, "insecure string pickle"
>>
>>Variables 
>>builtinValueError  
>>
>> Context 
>>
>> locals request session response
>> In file: 
>> C:\web2py-m\applications\admin\compiled\controllers.default.errors.pyc 
>>
>> 1.
>>
>>  at 072EADA0, file 
>> "C:/web2py-m/applications/admin\compiled\controllers.default.errors.py", 
>> line 3>
>>
>> -- 
> 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+un...@googlegroups.com .
> For more 

Re: [web2py] Re: insecure string pickle

2017-09-06 Thread Kiran Subbaraman
Didn't notice it earlier, but the error seems to have been raised from a 
2.9.12 web2py system. So, just to confirm, you have copied your 2.9.11 
app, into a 2.14.6 web2py environment. And trying to run it from in there.
Also, looks like you had pre-compiled the 2.9.11 app. It is a good idea 
to remove all the *.pyc files from in there. And then copy it into your 
2.14.6 environment.


If you were to use the admin interface, then there is a "Clean up App" ( 
I don't remember the specific name) option there, which you could use, 
before you start running the app.



Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On 06-Sep-17 12:53 PM, Wabbajack wrote:

Hi Kiran,

Yes the folders cache, sessions, and error have no file inside...
Is there any other way to clear this folders?
I just manually delete all files in each folder..
and also i have tried restarting the web2py itself

Still the error exist

Thanks,
Jak

On Wednesday, September 6, 2017 at 3:11:36 PM UTC+8, Kiran Subbaraman 
wrote:


You should clear out the following files - sessions / errors /
cache content - from your 2.9.11 based application


Kiran Subbaraman
http://subbaraman.wordpress.com/about/


On 06-Sep-17 10:26 AM, Wabbajack wrote:

Hi I also go this Error...

I am running Win7 computer
I used web2py 2.9.11 when i created an app before
with database and etc.

Now i have new applications running 2.14.6 with no problem also...

But when i copied the old application created on my previous
web2py<2.9.11>
into web2py<2.14.6> to pack it all up in one running web2py

then i got this error specific to applications created on 2.9.11

I thought it is back compatible with the newer releases...

Thanks,
Jak



On Tuesday, February 3, 2015 at 12:43:41 PM UTC+8, Dmitry
Ermolaev wrote:


Error ticket for "admin"


  Ticket ID

127.0.0.1.2015-02-03.07-40-32.4dc31e25-5b8c-4c78-b525-2a58b4ff7015


 insecure string pickle


  Версия

web2py™ Version 2.9.12-stable+timestamp.2015.01.17.06.11.03
Python  Python 2.7.6: C:\Python27\python.exe (prefix:
C:\Python27)


  Traceback

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



Traceback(most recent call last): 
File"C:\web2py-m\gluon\restricted.py", line224, in restricted
 exec ccodein environment
   
File"C:/web2py-m/applications/admin\compiled\controllers.default.errors.py
", line1945, in  
File"C:\web2py-m\gluon\globals.py", line393, in  self._caller= lambda f: f() 
File"C:/web2py-m/applications/admin\compiled\controllers.default.errors.py
", line1554, in errors
   File"C:\Python27\lib\pickle.py", line1378, in load
 return Unpickler(file).load() File"C:\Python27\lib\pickle.py", 
line858, in load
 dispatch[key](self) File"C:\Python27\lib\pickle.py", line966, in 
load_string
 raise ValueError, "insecure string pickle" ValueError: insecure 
string pickle


  Error snapshot help
  


|(insecure string pickle)|

inspect attributes


Frames

 *

*File C:\web2py-m\gluon\restricted.py in restricted at
line 224* код аргументы переменные

 *

*File

C:\web2py-m\applications\admin\compiled\controllers.default.errors.py
 in  at
line 1945* код аргументы переменные

 *

*File C:\web2py-m\gluon\globals.py in  at line
393* код аргументы переменные

 *

*File

C:\web2py-m\applications\admin\compiled\controllers.default.errors.py
 in errors at line
1554* код аргументы переменные

 *

*File C:\Python27\lib\pickle.py in load at line 1378* код
аргументы переменные

 *

*File C:\Python27\lib\pickle.py in load at line 858* код
аргументы переменные

 *

*File C:\Python27\lib\pickle.py in load_string at line
966* код аргументы переменные


  Function argument list

(self=)


  Code listing

961.
962.
963.
964.
965.
966.

967.
968.
969.
970.

 

Re: [web2py] Re: insecure string pickle

2017-09-06 Thread Wabbajack
Hi Kiran,

Yes exactly i have copied a 2.9.11 app into a 2.14.6 web2py environment and 
try to run it...
Also right now i tried removing *.pyc files... anyways i dont have much 
.pyc file... for now i have only deleted __init__.pyc  only from web2py 
files

Also i have Clean on the admin interface...
Sstill having the issue...

Thanks,
Jak



On Wednesday, September 6, 2017 at 3:37:09 PM UTC+8, Kiran Subbaraman wrote:
>
> Didn't notice it earlier, but the error seems to have been raised from a 
> 2.9.12 web2py system. So, just to confirm, you have copied your 2.9.11 app, 
> into a 2.14.6 web2py environment. And trying to run it from in there.
> Also, looks like you had pre-compiled the 2.9.11 app. It is a good idea to 
> remove all the *.pyc files from in there. And then copy it into your 2.14.6 
> environment.
>
> If you were to use the admin interface, then there is a "Clean up App" ( I 
> don't remember the specific name) option there, which you could use, before 
> you start running the app. 
>
> 
> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>
> On 06-Sep-17 12:53 PM, Wabbajack wrote:
>
> Hi Kiran,
>
> Yes the folders cache, sessions, and error have no file inside...
> Is there any other way to clear this folders? 
> I just manually delete all files in each folder..
> and also i have tried restarting the web2py itself 
>
> Still the error exist 
>
> Thanks,
> Jak
>
> On Wednesday, September 6, 2017 at 3:11:36 PM UTC+8, Kiran Subbaraman 
> wrote: 
>>
>> You should clear out the following files - sessions / errors / cache 
>> content - from your 2.9.11 based application
>>
>> 
>> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>>
>> On 06-Sep-17 10:26 AM, Wabbajack wrote:
>>
>> Hi I also go this Error...
>>
>> I am running Win7 computer
>> I used web2py 2.9.11 when i created an app before
>> with database and etc.
>>
>> Now i have new applications running 2.14.6 with no problem also...
>>
>> But when i copied the old application created on my previous 
>> web2py<2.9.11>
>> into web2py<2.14.6> to pack it all up in one running web2py
>>
>> then i got this error specific to applications created on 2.9.11
>>
>> I thought it is back compatible with the newer releases...
>>
>> Thanks,
>> Jak
>>
>>
>>
>> On Tuesday, February 3, 2015 at 12:43:41 PM UTC+8, Dmitry Ermolaev wrote: 
>>>
>>> Error ticket for "admin" Ticket ID 
>>>
>>> 127.0.0.1.2015-02-03.07-40-32.4dc31e25-5b8c-4c78-b525-2a58b4ff7015
>>>  insecure string pickle Версия 
>>> web2py™ Version 2.9.12-stable+timestamp.2015.01.17.06.11.03 
>>> Python Python 2.7.6: C:\Python27\python.exe (prefix: C:\Python27) 
>>> Traceback 
>>>
>>> 1.
>>> 2.
>>> 3.
>>> 4.
>>> 5.
>>> 6.
>>> 7.
>>> 8.
>>> 9.
>>> 10.
>>> 11.
>>> 12.
>>> 13.
>>> 14.
>>> 15.
>>>
>>> Traceback (most recent call last):
>>>   File "C:\web2py-m\gluon\restricted.py", line 224, in restricted
>>> exec ccode in environment
>>>   File 
>>> "C:/web2py-m/applications/admin\compiled\controllers.default.errors.py", 
>>> line 1945, in 
>>>   File "C:\web2py-m\gluon\globals.py", line 393, in 
>>> self._caller = lambda f: f()
>>>   File 
>>> "C:/web2py-m/applications/admin\compiled\controllers.default.errors.py", 
>>> line 1554, in errors
>>>   File "C:\Python27\lib\pickle.py", line 1378, in load
>>> return Unpickler(file).load()
>>>   File "C:\Python27\lib\pickle.py", line 858, in load
>>> dispatch[key](self)
>>>   File "C:\Python27\lib\pickle.py", line 966, in load_string
>>> raise ValueError, "insecure string pickle"ValueError: insecure string 
>>> pickle
>>>
>>> Error snapshot [image: help] 
>>> 
>>>  
>>>
>>> (insecure string pickle)
>>>
>>> inspect attributes
>>> Frames 
>>>
>>>- 
>>>
>>>*File C:\web2py-m\gluon\restricted.py in restricted at line 224* код 
>>>аргументы переменные
>>>- 
>>>
>>>*File 
>>>C:\web2py-m\applications\admin\compiled\controllers.default.errors.py 
>>> in  at line 1945* код 
>>>аргументы переменные
>>>- 
>>>
>>>*File C:\web2py-m\gluon\globals.py in  at line 393* код 
>>>аргументы переменные
>>>- 
>>>
>>>*File 
>>>C:\web2py-m\applications\admin\compiled\controllers.default.errors.py 
>>> in errors at line 1554* код 
>>>аргументы переменные
>>>- 
>>>
>>>*File C:\Python27\lib\pickle.py in load at line 1378* код аргументы 
>>>переменные
>>>- 
>>>
>>>*File C:\Python27\lib\pickle.py in load at line 858* код аргументы 
>>>переменные
>>>- 
>>>
>>>*File C:\Python27\lib\pickle.py in load_string at line 966* код 
>>>аргументы переменные
>>>Function argument list 
>>>
>>>(self=)
>>>Code listing 
>>>
>>>961.
>>>962.
>>>963.
>>

Re: [web2py] Re: insecure string pickle

2017-09-06 Thread Kiran Subbaraman

Hello Jak,
Not sure what could be causing the issue, then. Will get back to you if 
I have any useful suggestions.



Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On 06-Sep-17 1:26 PM, Wabbajack wrote:

Hi Kiran,

Yes exactly i have copied a 2.9.11 app into a 2.14.6 web2py 
environment and try to run it...
Also right now i tried removing *.pyc files... anyways i dont have 
much .pyc file... for now i have only deleted __init__.pyc only from 
web2py files


Also i have Clean on the admin interface...
Sstill having the issue...

Thanks,
Jak



On Wednesday, September 6, 2017 at 3:37:09 PM UTC+8, Kiran Subbaraman 
wrote:


Didn't notice it earlier, but the error seems to have been raised
from a 2.9.12 web2py system. So, just to confirm, you have copied
your 2.9.11 app, into a 2.14.6 web2py environment. And trying to
run it from in there.
Also, looks like you had pre-compiled the 2.9.11 app. It is a good
idea to remove all the *.pyc files from in there. And then copy it
into your 2.14.6 environment.

If you were to use the admin interface, then there is a "Clean up
App" ( I don't remember the specific name) option there, which you
could use, before you start running the app.


Kiran Subbaraman
http://subbaraman.wordpress.com/about/


On 06-Sep-17 12:53 PM, Wabbajack wrote:

Hi Kiran,

Yes the folders cache, sessions, and error have no file inside...
Is there any other way to clear this folders?
I just manually delete all files in each folder..
and also i have tried restarting the web2py itself

Still the error exist

Thanks,
Jak

On Wednesday, September 6, 2017 at 3:11:36 PM UTC+8, Kiran
Subbaraman wrote:

You should clear out the following files - sessions / errors
/ cache content - from your 2.9.11 based application


Kiran Subbaraman
http://subbaraman.wordpress.com/about/


On 06-Sep-17 10:26 AM, Wabbajack wrote:

Hi I also go this Error...

I am running Win7 computer
I used web2py 2.9.11 when i created an app before
with database and etc.

Now i have new applications running 2.14.6 with no problem
also...

But when i copied the old application created on my previous
web2py<2.9.11>
into web2py<2.14.6> to pack it all up in one running web2py

then i got this error specific to applications created on 2.9.11

I thought it is back compatible with the newer releases...

Thanks,
Jak



On Tuesday, February 3, 2015 at 12:43:41 PM UTC+8, Dmitry
Ermolaev wrote:


Error ticket for "admin"


  Ticket ID

127.0.0.1.2015-02-03.07-40-32.4dc31e25-5b8c-4c78-b525-2a58b4ff7015


 insecure string
pickle


  Версия

web2py™ Version
2.9.12-stable+timestamp.2015.01.17.06.11.03
Python  Python 2.7.6: C:\Python27\python.exe (prefix:
C:\Python27)


  Traceback

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



Traceback(most recent call last): 
File"C:\web2py-m\gluon\restricted.py", line224, in restricted
 exec ccodein environment
   
File"C:/web2py-m/applications/admin\compiled\controllers.default.errors.py
", line1945, in  
File"C:\web2py-m\gluon\globals.py", line393, in  self._caller= lambda f: f() 
File"C:/web2py-m/applications/admin\compiled\controllers.default.errors.py
", line1554, in errors
   File"C:\Python27\lib\pickle.py", line1378, in load
 return Unpickler(file).load() File"C:\Python27\lib\pickle.py", 
line858, in load
 dispatch[key](self) File"C:\Python27\lib\pickle.py", line966, 
in load_string
 raise ValueError, "insecure string pickle" ValueError: 
insecure string pickle


  Error snapshot help
  


|(insecure string pickle)|

inspect attributes


Frames

 *

*File C:\web2py-m\gluon\restricted.py in restricted
at line 224* код аргументы переменные

 *

*File

C:\web2py-m\applications\admin\compiled\

[web2py] Changing password error message

2017-09-06 Thread Simona Chovancová
I have a table defined like this:

form_change_password = auth.change_password()
form_change_password.element(
'input', _name='old_password')['_id'] = 'form-4'
form_change_password.element(
'input', _name='new_password')['_id'] = 'form-5'
form_change_password.element(
'input', _name='new_password2')['_id'] = 'form-6'

When I leave all fields empty, the new_password has same error_message as 
any other password, edited using db.auth_user.password.requires = ..., but 
the old_password has just 'Too short' as error_message, how do I change 
old_password's error_message?
Thank you.

-- 
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] Adding multiple records in single table

2017-09-06 Thread Shazia Nusrat
I have an application "Survey" for students where I need to update multiple
records against single table "Questions". These question features may vary
for each record as some would be multiple choices/radio/checkbox etc.
Following are my tables:

db.define_table('survey_question',
Field('question_text', 'string', label=T('Question'),
required=True),
Field('question_hint', 'string', label=T('Hint')),
Field('questiontype_id', 'reference questiontype',
label=T('Type')),
Field('questioncategory_id', 'reference category',
label=T('Category')),
Field('question_weight', 'integer', label=T('Weight
(0-5)'), default=0, requires=IS_INT_IN_RANGE(0,5)),
auth.signature,
format='%(question_text)s'
)

db.define_table('survey_question_choice',
Field('choice_text', 'string', label=T('Text')),
Field('choice_value', 'integer', label=T('Value')),
Field('question_id', 'reference survey_question',
label=T('Choice')),
auth.signature,
format='%(choice_text)s'
)

db.define_table('survey_question_subchoice',
Field('choice_text', 'string', label=T('Text')),
Field('choice_value', 'integer', label=T('Value')),
Field('question_choice_id', 'reference
survey_question_choice', label=T('Sub Choice')),
auth.signature,
format='%(choice_text)s'
)

db.define_table('survey_question_text',
Field('question_text', 'text', label=T('Text')),
Field('hint', 'string', label=T('Hint')),
Field('question_id', 'reference survey_question',
label=T('Question')),
auth.signature,
format='%(question_text)s'
)

db.define_table('survey_question_rating',
Field('start_label', 'string', label=T('Start Label')),
Field('finish_label', 'string', label=T('Finish Label')),
Field('step_size', 'double', label=T('Step Size')),
Field('num_stars', 'integer', label=T('Number of Stars')),
Field('question_id', 'reference survey_question',
label=T('Question')),
auth.signature,
format='%(start_label)s'
)

db.define_table('survey_response',
Field('survey_id', 'reference survey', label=T('Survey'),
required=True),
Field('user_id', 'reference auth_user', label=T('User')),
Field('complete', 'boolean', required=True, default=False),
auth.signature)

db.define_table('survey_text_response',
Field('question_id', 'reference survey_question',
label=T('Question')),
Field('text_value', 'string', label=T('Value')),
auth.signature,
migrate=True
)

db.define_table('survey_choice_response',
Field('response_id', 'reference survey_response',
required=True),
Field('choice_id', 'reference survey_question_choice',
required=True),
Field('choice_value', 'string', label=T('Value')),
auth.signature
)

db.define_table('survey_subchoice_response',
Field('response_id', 'reference survey_response',
required=True),
Field('subchoice_id', 'reference
survey_question_subchoice', required=True),
Field('choice_value', 'string', label=T('Value')),
auth.signature
)

db.define_table('survey_question_order',
Field('question_id', 'reference survey_question',
label=T('Question'), required=True),
Field('survey_id', 'reference survey', label=T('Survey'),
required=True),
Field('question_order', 'integer', required=True),
auth.signature,
format='%(order)s'
)

db.define_table('survey_conditional_order',
Field('question_order_id', 'reference
survey_question_order', label=T('Question Order')),
Field('response_question_id', 'reference survey_question'),
Field('positive_response_question_order_id', 'reference
survey_question_order'),
Field('negative_response_question_order_id', 'reference
survey_question_order'),
auth.signature
)

My Views: (Under Development)

def create_question():
form = SQLFORM.factory(db.survey_question, db.survey_question_choice,
db.survey_question_subchoice, db.survey_question_text)
rating = SQLFORM(db.rating)
if form.accepted:
flash.message='Thanks for creating survey questions'
redirect(URL('thank_you'))
return locals()

def take_survey():
uuid = request.args(0)
survey = db.survey(uuid=uuid) or redirect(URL('survey'))
if survey.requires_login:

[web2py] Re: Adding multiple records in single table

2017-09-06 Thread 黄祥
just an idea, why not create everything into 1 SQLFORM.factory() and then 
store them into a session, during form.validate(), you can validate the 
data and insert or update into their own tables

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: how to save controller vars into a field?

2017-09-06 Thread Leonel Câmara
One way to do it would be:

saved_menu_vars = urllib.quote(json.dumps(request.get_vars))

Then in the controller you could:

url_vars = json.loads(request.vars.saved_menu_vars)

Or you could simply:

URL('default', 'manage_menu_favorites', vars=dict(specificURL = 
request.url, **request.get_vars))

Then in the controller you assume that any vars that is not specificURL is 
one of the new favorite get vars. Which is fine if you don't use 
specificURL anywhere else. 

-- 
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: Changing password error message

2017-09-06 Thread Anthony
Why do you want to validate the old password? The only requirement should 
be that it actually matches the old password, and therefore the only error 
message you would want to report is that the password doesn't match (which 
can be customized via auth.messages.invalid_password).

Anthony

On Wednesday, September 6, 2017 at 6:08:00 AM UTC-4, Simona Chovancová 
wrote:
>
> I have a table defined like this:
>
> form_change_password = auth.change_password()
> form_change_password.element(
> 'input', _name='old_password')['_id'] = 'form-4'
> form_change_password.element(
> 'input', _name='new_password')['_id'] = 'form-5'
> form_change_password.element(
> 'input', _name='new_password2')['_id'] = 'form-6'
>
> When I leave all fields empty, the new_password has same error_message as 
> any other password, edited using db.auth_user.password.requires = ..., but 
> the old_password has just 'Too short' as error_message, how do I change 
> old_password's error_message?
> Thank you.
>

-- 
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: insecure string pickle

2017-09-06 Thread Dave S


On Wednesday, September 6, 2017 at 12:23:50 AM UTC-7, Wabbajack wrote:
>
> Hi Kiran,
>
> Yes the folders cache, sessions, and error have no file inside...
> Is there any other way to clear this folders? 
> I just manually delete all files in each folder..
> and also i have tried restarting the web2py itself 
>
> Still the error exist 
>
> Thanks,
> Jak
>

You probably noticed that the sessions directory has subfolders, and you 
made sure these are empty, as well.
(I would do a rm -r myapp/sessions ... or use a gui to do the same, such as 
the Files application on Linux,
or my favorite ... Beyond Compare.)

/dps


> On Wednesday, September 6, 2017 at 3:11:36 PM UTC+8, Kiran Subbaraman 
> wrote:
>>
>> You should clear out the following files - sessions / errors / cache 
>> content - from your 2.9.11 based application
>>
>> 
>> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>>
>> On 06-Sep-17 10:26 AM, Wabbajack wrote:
>>
>> Hi I also go this Error...
>>
>> I am running Win7 computer
>> I used web2py 2.9.11 when i created an app before
>> with database and etc.
>>
>> Now i have new applications running 2.14.6 with no problem also...
>>
>> But when i copied the old application created on my previous 
>> web2py<2.9.11>
>> into web2py<2.14.6> to pack it all up in one running web2py
>>
>> then i got this error specific to applications created on 2.9.11
>>
>> I thought it is back compatible with the newer releases...
>>
>> Thanks,
>> Jak
>>
>>
>>
>> On Tuesday, February 3, 2015 at 12:43:41 PM UTC+8, Dmitry Ermolaev wrote: 
>>>
>>> Error ticket for "admin" Ticket ID 
>>>
>>> 127.0.0.1.2015-02-03.07-40-32.4dc31e25-5b8c-4c78-b525-2a58b4ff7015
>>>  insecure string pickle Версия 
>>> web2py™ Version 2.9.12-stable+timestamp.2015.01.17.06.11.03 
>>> Python Python 2.7.6: C:\Python27\python.exe (prefix: C:\Python27) 
>>> Traceback 
>>>
>>> 1.
>>> 2.
>>> 3.
>>> 4.
>>> 5.
>>> 6.
>>> 7.
>>> 8.
>>> 9.
>>> 10.
>>> 11.
>>> 12.
>>> 13.
>>> 14.
>>> 15.
>>>
>>> Traceback (most recent call last):
>>>   File "C:\web2py-m\gluon\restricted.py", line 224, in restricted
>>> exec ccode in environment
>>>   File 
>>> "C:/web2py-m/applications/admin\compiled\controllers.default.errors.py", 
>>> line 1945, in 
>>>   File "C:\web2py-m\gluon\globals.py", line 393, in 
>>> self._caller = lambda f: f()
>>>   File 
>>> "C:/web2py-m/applications/admin\compiled\controllers.default.errors.py", 
>>> line 1554, in errors
>>>   File "C:\Python27\lib\pickle.py", line 1378, in load
>>> return Unpickler(file).load()
>>>   File "C:\Python27\lib\pickle.py", line 858, in load
>>> dispatch[key](self)
>>>   File "C:\Python27\lib\pickle.py", line 966, in load_string
>>> raise ValueError, "insecure string pickle"ValueError: insecure string 
>>> pickle
>>>
>>> Error snapshot [image: help] 
>>> 
>>>  
>>>
>>> (insecure string pickle)
>>>
>>> inspect attributes
>>> Frames 
>>>
>>>- 
>>>
>>>*File C:\web2py-m\gluon\restricted.py in restricted at line 224* код 
>>>аргументы переменные
>>>- 
>>>
>>>*File 
>>>C:\web2py-m\applications\admin\compiled\controllers.default.errors.py 
>>> in  at line 1945* код 
>>>аргументы переменные
>>>- 
>>>
>>>*File C:\web2py-m\gluon\globals.py in  at line 393* код 
>>>аргументы переменные
>>>- 
>>>
>>>*File 
>>>C:\web2py-m\applications\admin\compiled\controllers.default.errors.py 
>>> in errors at line 1554* код 
>>>аргументы переменные
>>>- 
>>>
>>>*File C:\Python27\lib\pickle.py in load at line 1378* код аргументы 
>>>переменные
>>>- 
>>>
>>>*File C:\Python27\lib\pickle.py in load at line 858* код аргументы 
>>>переменные
>>>- 
>>>
>>>*File C:\Python27\lib\pickle.py in load_string at line 966* код 
>>>аргументы переменные
>>>Function argument list 
>>>
>>>(self=)
>>>Code listing 
>>>
>>>961.
>>>962.
>>>963.
>>>964.
>>>965.
>>>966.
>>>
>>>967.
>>>968.
>>>969.
>>>970.
>>>
>>>def load_string(self):
>>>rep = self.readline()[:-1]
>>>for q in "\"'": # double or single quote
>>>if rep.startswith(q):
>>>if len(rep) < 2 or not rep.endswith(q):
>>>raise ValueError, "insecure string pickle"
>>>
>>>rep = rep[len(q):-len(q)]
>>>break
>>>else:
>>>raise ValueError, "insecure string pickle"
>>>
>>>Variables 
>>>builtinValueError  
>>>
>>> Context 
>>>
>>> locals request session response
>>> In file: 
>>> C:\web2py-m\applications\admin\compiled\controllers.default.errors.pyc 
>>>
>>> 1.
>>>
>>>  at 072EADA0, file 
>>> "C

[web2py] Re: how to save controller vars into a field?

2017-09-06 Thread Alex Glaros
am still having trouble making it work

What data structure type do I vars in so that user can return next day and 
have bookmarks work? Right now is stored in "string" field in a regular 
table. Tried "json" field type but Postgres rejected. Is it supposed be 
some sort of dictionary field? Field('saved_menu_vars', 'string')

VIEW THAT CAPTURES CURRENT PAGE VARS

{{import json}} <-- side question: Why "import json" only works in view 
and not controller?
{{=A('Add this page or manage bookmarks', _href=URL('default', 
'manage_menu_favorites', vars=dict(specificURL = request.url, 
saved_menu_vars =  json.dumps(request.get_vars))), _class='btn btn-warning 
btn-lg', 
_style='font-size:120%;float:left;padding:10px;margin:10px;text-transform: 
capitalize;')}}

CONTROLLER THAT SAVES VARS INTO A TABLE

justCreatedBookMark = 
db.menu_favorites.insert(menu_favorites_redirect_parms = 
json.loads(saved_menu_vars), menu_favorites_title = 
form.vars.title_of_your_bookmark, user_fk = auth.user_id)

VIEW THAT DISPLAYS BOOKMARKS

{{for r in session.menuFavoritesSet:}}
{{=A(r.menu_favorites_title, 
_href=URL(r.menu_favorites_url, 
vars=json.loads(r.menu_favorites_redirect_parms)))}}
{{pass}}

Is there a better way to test contents of saved vars?

am a little confused with: **request.get_vars  
The vars are stored in a table. How does that get them out of their field?

thanks

Alex

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