[web2py] Re: IntegrityError: column email is not unique

2013-12-17 Thread Massimo Di Pierro
The problem is that my workaround is not retroactive. I believe the bug is 
fixed but does not apply to tables created before the upgrade with the 
fixed code.
You have to manually alter table and remove the UNIQUE attribute. web2py is 
not smart enough to be able to do that.

On Tuesday, 17 December 2013 16:38:11 UTC-6, Chris Hepworth wrote:
>
> Running version 2.8.2-stable+timestamp.2013.11.28.13.54.07 I recieved the 
> same error as described above. I also tried to use the workaround Massimo 
> suggested below, but without success, the update still fails. Do I need to 
> delete my current archive table before attempting this? 
>
> On Monday, July 16, 2012 3:54:54 PM UTC-6, Remco K wrote:
>>
>> Hi everyone,
>>
>> I got stuck in creating an update form for an auth_user.
>>
>> In the auth_user table i made an extra field:
>>
>> Field('email', length=128, default='', unique=True, notnull=True),
>>
>> Now everytime i try to update the user information (the last name) i get 
>> the error:
>>
>> IntegrityError: column email is not unique
>>
>> I try to combine updating the user information with creating an archive 
>> entry for the previous entry:
>>
>> _id = db.auth_user(request.args(0)) or redirect(URL('index'))
>> form = SQLFORM(db.auth_user, _id)
>> if form.process(onsuccess=auth.archive).accepted:
>>
>> This method works for an other table which doesnt have an Field with 
>> Unique=True but not for this table with this Unique=True value.
>>
>> Someone who can help me out a bit?
>>
>> Thanks in advance!
>> Remco
>
>

-- 
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/groups/opt_out.


Re: [web2py] Re: sessions2trash cron

2013-12-17 Thread Jayadevan M
Thanks. For each app, I will add a line to web2py.ini like
python /var/www/web2py/web2py.py -Q -S myapp1 -M -R
scripts/sessions2trash.py -A -o
python /var/www/web2py/web2py.py -Q -S myapp2 -M -R
scripts/sessions2trash.py -A -o
?


On Wed, Dec 18, 2013 at 1:26 AM, Niphlod  wrote:

> here
> https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh#L145
> uwsgi takes care of it with the default setup, with the added bonus that
> the user running uwsgi has all the necessary permission to run that script.
>
> On Tuesday, December 17, 2013 7:04:19 AM UTC+1, Jayadevan M wrote:
>>
>> I have
>>  [uwsgi-cron] command "python /var/www/web2py/web2py.py -Q -S
>> welcome -M -R scripts/sessions2trash.py -A -o" registered as cron task
>> in my uwsgi log (because the cron is mentioned in the config file for
>> uwsgi).
>> Under which user/how can I really see this cron entry?
>>
>>  --
> 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/3Sqo8gQ7ya8/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/groups/opt_out.
>

-- 
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/groups/opt_out.


Re: [web2py] How to include symbols as ✎ or ✆ in a the helper A()?

2013-12-17 Thread Omar Meat Boy Gutiérrez

It works enclosing the text with XML().

Thanks!

On Tuesday, December 17, 2013 7:29:21 PM UTC-6, Roberto Perdomo wrote:
>
> Try with something like:
>
> {{=A(XML('✖'), _href=URL('default', 'delete', args=[row.id]))}}
>
>
>
>
> 2013/12/17 Omar Meat Boy Gutiérrez >
>
>>
>> I have a table of items with a special column to delete each item. I'd 
>> like include a symbol like: ✖ or ✕ or ✗, in this way:
>>
>>  X   Y   Z   Delete
>> -
>>  xy   z   [✖]
>>  xy   z   [✖]
>>
>> I am trying with:
>>
>> {{=A('✖', _href=URL('default', 'delete', args=[row.id]))}}
>>
>> however my result is more or less:
>>
>>  X   Y   Z   Delete
>> -
>>  xy   z   [✖]
>>  xy   z   [✖]
>>
>> When I use: 
>>
>> ✖
>>
>> it works (symbols are correctly displayed) but I'd like to use A helper 
>> because is a more pythonic way to do it. 
>>
>> What am I doing wrong!
>>
>> -- 
>> 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 options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
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/groups/opt_out.


[web2py] How to show HTML entitie symbols using A helper?

2013-12-17 Thread Omar Meat Boy Gutiérrez


I am trying to show a delete symbol like this ✕ or this: ✖.

My code is:

{{=A('✖', _href=URL('default', 'delete', args=[row.id]))}}

My result is simply:

✖ 

If I use HTML I get the desired result;

✖


However, I'd like to do it using *A helper* because I want to take 
advantage of it. What am I doing wrong?














-- 
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/groups/opt_out.


Re: [web2py] How to include symbols as ✎ or ✆ in a the helper A()?

2013-12-17 Thread Roberto Perdomo
Try with something like:

{{=A(XML('✖'), _href=URL('default', 'delete', args=[row.id]))}}




2013/12/17 Omar Meat Boy Gutiérrez 

>
> I have a table of items with a special column to delete each item. I'd
> like include a symbol like: ✖ or ✕ or ✗, in this way:
>
>  X   Y   Z   Delete
> -
>  xy   z   [✖]
>  xy   z   [✖]
>
> I am trying with:
>
> {{=A('✖', _href=URL('default', 'delete', args=[row.id]))}}
>
> however my result is more or less:
>
>  X   Y   Z   Delete
> -
>  xy   z   [✖]
>  xy   z   [✖]
>
> When I use:
>
> ✖
>
> it works (symbols are correctly displayed) but I'd like to use A helper
> because is a more pythonic way to do it.
>
> What am I doing wrong!
>
> --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.


[web2py] How to include symbols as ✎ or ✆ in a the helper A()?

2013-12-17 Thread Omar Meat Boy Gutiérrez

I have a table of items with a special column to delete each item. I'd like 
include a symbol like: ✖ or ✕ or ✗, in this way:

 X   Y   Z   Delete
-
 xy   z   [✖]
 xy   z   [✖]

I am trying with:

{{=A('✖', _href=URL('default', 'delete', args=[row.id]))}}

however my result is more or less:

 X   Y   Z   Delete
-
 xy   z   [✖]
 xy   z   [✖]

When I use: 

✖

it works (symbols are correctly displayed) but I'd like to use A helper 
because is a more pythonic way to do it. 

What am I doing wrong!

-- 
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/groups/opt_out.


[web2py] Re: List:string display missing the + and - since about 2.7

2013-12-17 Thread Mark Kirkwood
Confirmed, the excellent quality of the Changelog included with the src is 
much appreciated. I must remember to read it *before* posting questions...

-- 
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/groups/opt_out.


[web2py] Re: List:string display missing the + and - since about 2.7

2013-12-17 Thread Mark Kirkwood
I think this is due to me forgetting to update static/js/web2py.js from the 
2.7 or 2.8 welcome app, but will confirm.

-- 
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/groups/opt_out.


[web2py] List:string display missing the + and - since about 2.7

2013-12-17 Thread Mark Kirkwood
I'm making use of list:string to store registration numbers (for cats):

db.define_table(
'cat',
...   
Field('reg_numbers', 'list:string'),
format = '%(name)s'
)

and using sqlform.grid in the 'cat' controller. For web2py versions <= 
2.4.x  this worked fine - displaying a text box with trailing '+' and '-' 
to add or remove list entries.

I noticed after updating to 2.8.2 that the +/_ controls had vanished. I 
happened to have a 2.7.4 zip and well and thay have vanished in that 
version too. Is there some new way this works now, or is it a bug?

Cheers

Mark

-- 
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/groups/opt_out.


Re: [web2py] Apostrophe's disapperaing

2013-12-17 Thread Jonathan Lundell
On 17 Dec 2013, at 3:32 PM, Dave S  wrote:
> On Monday, December 16, 2013 7:15:12 AM UTC-8, Jonathan Lundell wrote:
> On 16 Dec 2013, at 2:18 AM, peter  wrote:
>> I am impressed at how helpful you have been on this Jonathon.
>> 
>> It does say in the mht file that it is windows-1252 encoded.
>> 
>> It turns out that 
>> s.decode('cp1252').encode('utf-8')
>> 
>> is working correctly. I mistakenly thought it was not
>> 
>> because I got this error 
>> UnicodeEncodeError: 'charmap' codec can't encode character u'\u2018' in 
>> position 193: character maps to 
>> This was from a print statement. It turns out you get this error when trying 
>> to print the left single quotation mark that is correcty coded in unicode. 
>> So this is why I was having such problems. This error is presumably because 
>> the print statement is working in dos mode, this character is not in the dos 
>> character set. So using print to check out what is going on in python is not 
>> a good idea when using unicode.
>> 
>> Obvious with hindsight, not so obvious without hindsight.
>>  
>> Thanks again Jonathon for all your support on this.
>> 
> 
> You're welcome.
> 
> I'm sympathetic, having struggled to understand character encoding myself. 
> 
> FWIW, I've leaning more and more toward the Python 3 approach to text, 
> decoding all my strings to unicode on input, encoding as needed on output. 
> (Python 3's standardization on Unicode almost persuades me that Python 3 was 
> a good idea.)
> 
> And which Unicode is that?  Over in Mercurial-land, there is still gnashing 
> of teeth because Windows chose UTF-16, and "everyone else" chose UTF-8 (that 
> is, most Linux distros).
> 

Unicode in Python is a built-in type, neither utf-8 nor utf-16. This is true in 
both Python 2 & 3; it's just that in Python 3 it's the *only* string (text) 
type. You can encode a unicode string into a utf-8 or utf-16 byte string, but 
that's an encoded byte string, not unicode.

There's some detail on Python's internal handling of Unicode here: 
http://docs.python.org/2/c-api/unicode.html

-- 
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/groups/opt_out.


Re: [web2py] Apostrophe's disapperaing

2013-12-17 Thread Dave S


On Monday, December 16, 2013 7:15:12 AM UTC-8, Jonathan Lundell wrote:
>
> On 16 Dec 2013, at 2:18 AM, peter > 
> wrote:
>
> I am impressed at how helpful you have been on this Jonathon.
>
> It does say in the mht file that it is windows-1252 encoded.
>
> It turns out that 
> s.decode('cp1252').encode('utf-8')
>
> is working correctly. I mistakenly thought it was not
>
> because I got this error 
> UnicodeEncodeError: 'charmap' codec can't encode character u'\u2018' in 
> position 
> 193: character maps to 
> This was from a print statement. It turns out you get this error when 
> trying to print the left single quotation mark that is correcty coded in 
> unicode. So this is why I was having such problems. This error is 
> presumably because the print statement is working in dos mode, this 
> character is not in the dos character set. So using print to check out what 
> is going on in python is not a good idea when using unicode.
>
> Obvious with hindsight, not so obvious without hindsight.
>  
> Thanks again Jonathon for all your support on this.
>
>
> You're welcome.
>
> I'm sympathetic, having struggled to understand character encoding myself. 
>
> FWIW, I've leaning more and more toward the Python 3 approach to 
> text, decoding all my strings to unicode on input, encoding as needed on 
> output. (Python 3's standardization on Unicode almost persuades me that 
> Python 3 was a good idea.)
>

And which Unicode is that?  Over in Mercurial-land, there is still gnashing 
of teeth because Windows chose UTF-16, and "everyone else" chose UTF-8 
(that is, most Linux distros).

/dps

-- 
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/groups/opt_out.


[web2py] Re: login crash under 2.8.2

2013-12-17 Thread Massimo Di Pierro
t would help a lot to know what the session object looks like so that we 
can try reproduce the problem. I assume this is for a particular session 
object. Can you retrieve the session_id from the cookie and send me the 
corresponding file? Do you know how the lock object gets into the session? 
I do not think it is put there by web2py.

On Tuesday, 17 December 2013 11:44:10 UTC-6, Leonel Câmara wrote:
>
> I'm still getting another problem if I store cookies in files as usual:
>
> Traceback (most recent call last):
>   File "C:\blueweb2py\gluon\main.py", line 479, in wsgibase
> session._try_store_in_cookie_or_file(request, response)
>   File "C:\blueweb2py\gluon\globals.py", line 1089, in 
> _try_store_in_cookie_or_file
> return self._try_store_in_file(request, response)
>   File "C:\blueweb2py\gluon\globals.py", line 1096, in _try_store_in_file
> or self._unchanged(response)):
>   File "C:\blueweb2py\gluon\globals.py", line 1041, in _unchanged
> session_pickled = cPickle.dumps(self)
>   File "C:\Python27\Lib\copy_reg.py", line 70, in _reduce_ex
> raise TypeError, "can't pickle %s objects" % base.__name__
> TypeError: can't pickle lock objects
>
>
> Which is definetely a bug since lock objects shouldn't be going into the 
> session, or, if they are, session needs to have a __getstate__ that removes 
> them. 
>
>

-- 
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/groups/opt_out.


Re: [web2py] Re: login crash under 2.8.2

2013-12-17 Thread Massimo Di Pierro
I do not fully understand the details but there is a note in the pyhton 
docs that says that __getstate__ can return False. If it does __setstate__ 
is not called.
If I change __getstate__ to return dict(self) or if I remove it, sessions 
break.

On Tuesday, 3 December 2013 13:50:33 UTC-6, Jonathan Lundell wrote:
>
> On 3 Dec 2013, at 9:59 AM, Massimo Di Pierro 
> > 
> wrote:
>
> Is this with 2.8.2?
>
>
> This confuses me. In Storage, we say:
>
> __getstate__ = lambda self: None
>
> ...but the pickling logic ends up calling what __getstate__ returns 
> (without checking for None), which would explain the crash below. The 
> confusing part is that it's been this way for a while, right? 
>
> FastStorage, OTOH, has:
>
> def __getstate__(self):
> return dict(self)
>
>
>
>
> On Tuesday, 3 December 2013 05:59:11 UTC-6, lucas wrote:
>>
>> hey everyone,
>>
>> thanx for the help on my prior posts, things are moving along.  i now get 
>> a crash when i try to login under the application,  the traceback is:
>>
>> Traceback (most recent call last):
>>   File "/opt/web-apps/web2py/gluon/main.py", line 479, in wsgibase
>> session._try_store_in_cookie_or_file(request, response)
>>   File "/opt/web-apps/web2py/gluon/globals.py", line 1089, in 
>> _try_store_in_cookie_or_file
>> return self._try_store_in_file(request, response)
>>   File "/opt/web-apps/web2py/gluon/globals.py", line 1096, in 
>> _try_store_in_file
>> or self._unchanged(response)):
>>   File "/opt/web-apps/web2py/gluon/globals.py", line 1041, in _unchanged
>> session_pickled = cPickle.dumps(self)
>>   File "/usr/lib/python2.6/copy_reg.py", line 84, in _reduce_ex
>> dict = getstate()
>> TypeError: 'NoneType' object is not callable
>>
>> none of this points to my code, so i believe it is in web2py.  or, do i have 
>> to adjust something in my code to compensate for the update.  i have cleared 
>> all sessions and copied the web2py.js appadmin.html and appadmin.py into my 
>> applications and made the appropriate changes in apache config files as per 
>> my prior two tickets.
>>
>> ok, lucas
>>
>>
>
>
>

-- 
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/groups/opt_out.


[web2py] Re: IntegrityError: column email is not unique

2013-12-17 Thread Chris Hepworth
Running version 2.8.2-stable+timestamp.2013.11.28.13.54.07 I recieved the 
same error as described above. I also tried to use the workaround Massimo 
suggested below, but without success, the update still fails. Do I need to 
delete my current archive table before attempting this? 

On Monday, July 16, 2012 3:54:54 PM UTC-6, Remco K wrote:
>
> Hi everyone,
>
> I got stuck in creating an update form for an auth_user.
>
> In the auth_user table i made an extra field:
>
> Field('email', length=128, default='', unique=True, notnull=True),
>
> Now everytime i try to update the user information (the last name) i get 
> the error:
>
> IntegrityError: column email is not unique
>
> I try to combine updating the user information with creating an archive 
> entry for the previous entry:
>
> _id = db.auth_user(request.args(0)) or redirect(URL('index'))
> form = SQLFORM(db.auth_user, _id)
> if form.process(onsuccess=auth.archive).accepted:
>
> This method works for an other table which doesnt have an Field with 
> Unique=True but not for this table with this Unique=True value.
>
> Someone who can help me out a bit?
>
> Thanks in advance!
> Remco

-- 
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/groups/opt_out.


Re: [web2py] Re: Password Transmitted in plain text

2013-12-17 Thread Jonathan Lundell
On 17 Dec 2013, at 2:28 PM, P T  wrote:
> Thank you Leonel and Jonathan,
> 
> But, thees lines require that I run a https server. Can we configure Rocket 
> server for https or should I deploy something like Apache?

Rocket supports SSL if the ssl module is available on the system.

You'll need a certificate. Depending on what you're doing with it, a 
self-signed certificate might be adequate. Otherwise you can get a free 
single-host certificate from someone like: http://www.startssl.com/?app=40


> 
> Thanks for the help,
> PT
> 
> 
> 
> On Tuesday, December 17, 2013 4:11:57 PM UTC-6, Leonel Câmara wrote:
> Of course they are. Use HTTPS if you don't want that to happen.
> 
> request.requires_https()
> 
> and
> 
> session.secure()
> 
> Are your friends.
> 
> Terça-feira, 17 de Dezembro de 2013 22:08:34 UTC, P T escreveu:
> I deployed a small app on the intranet and noticed that the username and 
> password are transmitted in plain text (using a tool WireShark, 
> http://www.wireshark.org/).
> 
> Here is my setup: 
> 2.8.2-stable+timestamp.2013.11.28.13.54.07
> (Running on Rocket 1.2.6, Python 2.7.6) 
> Database: Postgresql
> 
> So, I checked the model and noticed that my auth did not include hmac_key. 
> So, I changed that to
> 
> auth = Auth(db, hmac_key=Auth.get_or_create_key()) 
> 
> But, this did not help either.
> 
> What should I do to make sure that user's passwords are transmitted as 
> encrypted? 
> 
> Thanks,
> PT
> 
> -- 
> 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)



-- 
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/groups/opt_out.


[web2py] Re: Password Transmitted in plain text

2013-12-17 Thread P T
Thank you Leonel and Jonathan,

But, thees lines require that I run a https server. Can we configure Rocket 
server for https or should I deploy something like Apache?

Thanks for the help,
PT



On Tuesday, December 17, 2013 4:11:57 PM UTC-6, Leonel Câmara wrote:
>
> Of course they are. Use HTTPS if you don't want that to happen.
>
> request.requires_https()
>
> and
>
> session.secure()
>
> Are your friends.
>
> Terça-feira, 17 de Dezembro de 2013 22:08:34 UTC, P T escreveu:
>>
>> I deployed a small app on the intranet and noticed that the username and 
>> password are transmitted in plain text (using a tool WireShark, 
>> http://www.wireshark.org/).
>>
>> Here is my setup: 
>> 2.8.2-stable+timestamp.2013.11.28.13.54.07
>> (Running on Rocket 1.2.6, Python 2.7.6) 
>> Database: Postgresql
>>
>> So, I checked the model and noticed that my auth did not include 
>> hmac_key. So, I changed that to
>>
>> auth = Auth(db, hmac_key=Auth.get_or_create_key()) 
>>
>> But, this did not help either.
>>
>> What should I do to make sure that user's passwords are transmitted as 
>> encrypted? 
>>
>> Thanks,
>> PT
>>
>

-- 
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/groups/opt_out.


Re: [web2py] Re: how do I create, multiple forms and precess them, using 'for' statement?

2013-12-17 Thread ivo . nijenhuis
Thank you! Will spend tomorrow figuring it out. Thanks for the example!

Sent from my iPhone

On 17 dec. 2013, at 23:21, Niphlod  wrote:

> you just need to figure out a "key" to separate different forms, and use 
> formname accordingly as stated in the book.
> I do it in w2p_tvseries already, you can take a look at 
> https://github.com/niphlod/w2p_tvseries/blob/master/controllers/manage.py
> specifically, see lines #169, #239 and #266
> 
> -- 
> 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/7O1sR3M4BRw/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/groups/opt_out.

-- 
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/groups/opt_out.


[web2py] Re: how do I create, multiple forms and precess them, using 'for' statement?

2013-12-17 Thread Niphlod
you just need to figure out a "key" to separate different forms, and use 
formname accordingly as stated in the book.
I do it in w2p_tvseries already, you can take a look at 
https://github.com/niphlod/w2p_tvseries/blob/master/controllers/manage.py
specifically, see lines #169, #239 and #266

-- 
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/groups/opt_out.


Re: [web2py] Password Transmitted in plain text

2013-12-17 Thread Jonathan Lundell
On 17 Dec 2013, at 2:08 PM, P T  wrote:
> I deployed a small app on the intranet and noticed that the username and 
> password are transmitted in plain text (using a tool WireShark, 
> http://www.wireshark.org/).
> 
> Here is my setup: 
> 2.8.2-stable+timestamp.2013.11.28.13.54.07
> (Running on Rocket 1.2.6, Python 2.7.6) 
> Database: Postgresql
> 
> So, I checked the model and noticed that my auth did not include hmac_key. 
> So, I changed that to
> 
> auth = Auth(db, hmac_key=Auth.get_or_create_key()) 
> 
> But, this did not help either.
> 
> What should I do to make sure that user's passwords are transmitted as 
> encrypted? 

Use SSL.

-- 
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/groups/opt_out.


[web2py] Re: Password Transmitted in plain text

2013-12-17 Thread Leonel Câmara
Of course they are. Use HTTPS if you don't want that to happen.

request.requires_https()

and

session.secure()

Are your friends.

Terça-feira, 17 de Dezembro de 2013 22:08:34 UTC, P T escreveu:
>
> I deployed a small app on the intranet and noticed that the username and 
> password are transmitted in plain text (using a tool WireShark, 
> http://www.wireshark.org/).
>
> Here is my setup: 
> 2.8.2-stable+timestamp.2013.11.28.13.54.07
> (Running on Rocket 1.2.6, Python 2.7.6) 
> Database: Postgresql
>
> So, I checked the model and noticed that my auth did not include hmac_key. 
> So, I changed that to
>
> auth = Auth(db, hmac_key=Auth.get_or_create_key()) 
>
> But, this did not help either.
>
> What should I do to make sure that user's passwords are transmitted as 
> encrypted? 
>
> Thanks,
> PT
>

-- 
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/groups/opt_out.


[web2py] Re: how do I create, multiple forms and precess them, using 'for' statement?

2013-12-17 Thread Ivo
I understand that I need to use different formnames, I just don't 
understand how I would syntax it do that automatically.
A single form will not suffice; I think is has to be different forms. I 
need a uuid for each user and create/update several records for each user.
Basically I need to use something like:

def show_form():
for user in users:
form= SQLFORM.factory()
return dict(form=form)
But then in a way that works. I tried several ways, but am still 
unsuccessful...
I read (, re-read and re-re-read) the chapter on forms in 'the book' but 
there's no mention on how to achieve something like this, neither in the 
examples.
I tried digging through a lot of the sample apps too but nothing.

I understand this is not the basic way forms are designed to be used but is 
it that uncommon to do this?
I also tried:
for user in users:
form[user]= SQLFORM.factory()
return dict(form[user]=form[user])
this throws a global name form is not defined.

I also tried:
for user in users:
form = SQLFORM.factory()
form[user] = form

any ideas?

On Tuesday, December 17, 2013 9:03:50 PM UTC+1, Massimo Di Pierro wrote:
>
> What does the model look like? You amy want to create a single form with 
> fields for each user.
>
> On Tuesday, 17 December 2013 05:14:25 UTC-6, Ivo wrote:
>>
>> I want to create multiple forms with a 'for' statement and 
>> validate/process them.
>> the amount of forms to generate is dependent on a list containing user 
>> id's.
>> the list is dynamic; so I have a function generating a list, 'users', 
>> which contains: user:1L, user:4L, etc...
>> now I want to create a form for each of them and after 'submit' process 
>> them.
>>
>> Normally I would just create a form in the controller like:
>> def show_form():
>>form = SQLFORM.x()
>>return dict(form=form)
>> and process it with:
>>if form.accepts
>>
>> however this would only generate one form... 
>> using:
>> def sow_form():
>> for user in users:
>> form = SQLFORM.x()
>>return dict(form=form) 
>> and calling it from the view with {{=form}} doesn't work either because 
>> of 'form' being static.
>>
>> Creating the form from the view is a lot easier to do with:
>> {{for user in users:}}
>> (my form)
>> {{pass}}
>>
>> but how do I process it?
>> I can give the form a unique name from the view with name="{{=user}}"
>> but then what?
>>
>> The form is mostly prepopulated with vars created/calculated from the 
>> view but a part of those can be created/calculated from the controller. 
>> the form requires a uuid which needed in the processing of the form.
>>
>> What is the best way to achieve this?
>> would:
>> def show_form():
>> for user in users:
>> form[user] = SQLFORM.x()
>> work? and how can I populate that form?
>>
>> Please point me in the right direction.
>>
>>
>>

-- 
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/groups/opt_out.


[web2py] Password Transmitted in plain text

2013-12-17 Thread P T
I deployed a small app on the intranet and noticed that the username and 
password are transmitted in plain text (using a tool WireShark, 
http://www.wireshark.org/).

Here is my setup: 
2.8.2-stable+timestamp.2013.11.28.13.54.07
(Running on Rocket 1.2.6, Python 2.7.6) 
Database: Postgresql

So, I checked the model and noticed that my auth did not include hmac_key. 
So, I changed that to

auth = Auth(db, hmac_key=Auth.get_or_create_key()) 

But, this did not help either.

What should I do to make sure that user's passwords are transmitted as 
encrypted? 

Thanks,
PT

-- 
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/groups/opt_out.


[web2py] Re: uploading files on GAE - 404 NOT FOUND

2013-12-17 Thread Alan Etkin


> Are there meant to be limitations around compute on GAE?
>

I don't think so, this could be a bug. Please file an issue and we'll try 
to reproduce and fix it.

-- 
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/groups/opt_out.


[web2py] Re: DAL issues on production server (xen VM)

2013-12-17 Thread Niphlod
they should be separated and they are separated from what I see in the 
code. the db connection of the scheduler is on the main thread while 
the one used by the task is inside the spawned process (the executor() 
function). I don't see connections shared between the two.

On Monday, December 16, 2013 10:29:41 PM UTC+1, Yassen D. wrote:
>
> Issue resolved. The source of all trouble was that the Scheduler uses the 
> same db connection as the task it executes. Thus output updates (print 
> '!clear!%(progress)s' % progress) changes the connection status, randomly, 
> hence the strange exceptions.
>
> Suggestion: explicitly mention this as a gotcha in the scheduler section 
> of the w2p book.
>
> Cheers,
> Yassen
>

-- 
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/groups/opt_out.


[web2py] Re: how to refer to other field in filter_in filter_out?

2013-12-17 Thread Ivan Gazzola
Currently I manage the upload folder in the controller with a function 
called by a ajax request.
But, for code optimization, I would prefer it be in the model.
I use this table in multiple pages and for different data files (jpg, tiff, 
pdf) and I would like to manage it in a single code.

Il giorno martedì 17 dicembre 2013 15:07:32 UTC+1, Anthony ha scritto:
>
> If you're dealing with form submissions, you could get the value from 
> request.post_vars.nome. Note, if you change the upload folder dynamically, 
> you will also need a way to set it when you retrieve the file.
>
> Anthony
>
> On Tuesday, December 17, 2013 7:35:09 AM UTC-5, Ivan Gazzola wrote:
>>
>> db.define_table('files',
>>Field('nome','reference Nomi',required=True, requires=[IS_IN_DB(db, 
>> 'Nomi.id')]),
>>Field('title', "string", unique=False,label="Descrizione"),
>>Field('note'),   
>>Field('immagine', 'upload', autodelete=True),
>>Field('datecreated','datetime',default=now,readable=False),
>>   
>>  
>> Field('data_file','date',label="Data",requires=IS_DATE(format=('%d/%m/%Y'
>>
>> I would like to set uploadfolder for immagine to ../data/nome.id  like 
>> "../data/3"
>>
>> How can I access the values of the fields in the same row?
>>
>> Thx
>>
>

-- 
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/groups/opt_out.


[web2py] Re: sessions2trash cron

2013-12-17 Thread Niphlod
here 
https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh#L145
uwsgi takes care of it with the default setup, with the added bonus that 
the user running uwsgi has all the necessary permission to run that script.

On Tuesday, December 17, 2013 7:04:19 AM UTC+1, Jayadevan M wrote:
>
> I have  
>  [uwsgi-cron] command "python /var/www/web2py/web2py.py -Q -S 
> welcome -M -R scripts/sessions2trash.py -A -o" registered as cron task 
> in my uwsgi log (because the cron is mentioned in the config file for 
> uwsgi). 
> Under which user/how can I really see this cron entry?
>
>

-- 
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/groups/opt_out.


[web2py] Re: how do I create, multiple forms and precess them, using 'for' statement?

2013-12-17 Thread Massimo Di Pierro
What does the model look like? You amy want to create a single form with 
fields for each user.

On Tuesday, 17 December 2013 05:14:25 UTC-6, Ivo wrote:
>
> I want to create multiple forms with a 'for' statement and 
> validate/process them.
> the amount of forms to generate is dependent on a list containing user 
> id's.
> the list is dynamic; so I have a function generating a list, 'users', 
> which contains: user:1L, user:4L, etc...
> now I want to create a form for each of them and after 'submit' process 
> them.
>
> Normally I would just create a form in the controller like:
> def show_form():
>form = SQLFORM.x()
>return dict(form=form)
> and process it with:
>if form.accepts
>
> however this would only generate one form... 
> using:
> def sow_form():
> for user in users:
> form = SQLFORM.x()
>return dict(form=form) 
> and calling it from the view with {{=form}} doesn't work either because of 
> 'form' being static.
>
> Creating the form from the view is a lot easier to do with:
> {{for user in users:}}
> (my form)
> {{pass}}
>
> but how do I process it?
> I can give the form a unique name from the view with name="{{=user}}"
> but then what?
>
> The form is mostly prepopulated with vars created/calculated from the view 
> but a part of those can be created/calculated from the controller. the 
> form requires a uuid which needed in the processing of the form.
>
> What is the best way to achieve this?
> would:
> def show_form():
> for user in users:
> form[user] = SQLFORM.x()
> work? and how can I populate that form?
>
> Please point me in the right direction.
>
>
>

-- 
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/groups/opt_out.


[web2py] Re: how do I create, multiple forms and precess them, using 'for' statement?

2013-12-17 Thread Niphlod
you need to use different formname(s) to be able to process them separately.
take a look here 
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Multiple-forms-per-page

On Tuesday, December 17, 2013 12:14:25 PM UTC+1, Ivo wrote:
>
> I want to create multiple forms with a 'for' statement and 
> validate/process them.
> the amount of forms to generate is dependent on a list containing user 
> id's.
> the list is dynamic; so I have a function generating a list, 'users', 
> which contains: user:1L, user:4L, etc...
> now I want to create a form for each of them and after 'submit' process 
> them.
>
> Normally I would just create a form in the controller like:
> def show_form():
>form = SQLFORM.x()
>return dict(form=form)
> and process it with:
>if form.accepts
>
> however this would only generate one form... 
> using:
> def sow_form():
> for user in users:
> form = SQLFORM.x()
>return dict(form=form) 
> and calling it from the view with {{=form}} doesn't work either because of 
> 'form' being static.
>
> Creating the form from the view is a lot easier to do with:
> {{for user in users:}}
> (my form)
> {{pass}}
>
> but how do I process it?
> I can give the form a unique name from the view with name="{{=user}}"
> but then what?
>
> The form is mostly prepopulated with vars created/calculated from the view 
> but a part of those can be created/calculated from the controller. the 
> form requires a uuid which needed in the processing of the form.
>
> What is the best way to achieve this?
> would:
> def show_form():
> for user in users:
> form[user] = SQLFORM.x()
> work? and how can I populate that form?
>
> Please point me in the right direction.
>
>
>

-- 
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/groups/opt_out.


[web2py] Re: we2py sql fetch

2013-12-17 Thread Massimo Di Pierro
Yes. psycopg2 has priority over pg8000.

On Tuesday, 17 December 2013 09:03:46 UTC-6, Jayadevan M wrote:
>
> I did a pip install psycopg2. If it is there,web2py will use it by 
> default? Now the repeat fetches have disappeared.
>
> On Tuesday, December 17, 2013 7:58:26 PM UTC+5:30, Massimo Di Pierro wrote:
>>
>> What if you use psycopg2?
>>
>> Massimo
>>
>> On Tuesday, 17 December 2013 08:25:01 UTC-6, Jayadevan M wrote:
>>>
>>> No. The number of fetches go up when the number of records go up. It is 
>>> a very simple test case. First I inserted 100 records. 
>>> insert into myt (nm, title) select generate_series(1,100), 'A';
>>>
>>> There was just one fetch. Then I inserted many more 
>>>  insert into myt (nm, title) select generate_series(100,10), 'A';
>>>
>>> If I see the log, it is like this . A parse, a bind, an execute, then 
>>> all 'execute fetch'es.
>>> 2013-12-17 19:07:57 IST [19893]: [23-1] user=myserrhpa,db=everest1 LOG:  
>>> duration: 0.577 ms  parse : select * from myt
>>> 2013-12-17 19:07:57 IST [19893]: [24-1] user=myserrhpa,db=everest1 LOG:  
>>> duration: 0.420 ms  bind /pg8000_portal_10: select * from myt
>>> 2013-12-17 19:07:57 IST [19893]: [25-1] user=myserrhpa,db=everest1 LOG:  
>>> duration: 0.148 ms  execute /pg8000_portal_10: select * from myt
>>> 2013-12-17 19:07:57 IST [19893]: [26-1] user=myserrhpa,db=everest1 LOG:  
>>> duration: 0.151 ms  execute fetch from /pg8000_portal_10: select * 
>>> from myt
>>> 2013-12-17 19:07:58 IST [19893]: [27-1] user=myserrhpa,db=everest1 LOG:  
>>> duration: 0.116 ms  execute fetch from /pg8000_portal_10: select * 
>>> from myt
>>>
>>> My test.py has just this 
>>> def querytest():
>>> sql="select * from myt "
>>> rows=db.executesql(sql)
>>> return dict(rows=rows)
>>>
>>> On Tuesday, December 17, 2013 7:46:45 PM UTC+5:30, Massimo Di Pierro 
>>> wrote:

 You may have hidden recursive selects, for example in a represent 
 function.

 On Tuesday, 17 December 2013 07:41:47 UTC-6, Jayadevan M wrote:
>
> When I turned on logging for PostgreSQL during testing, I see that the 
> number of fetches goes up dramatically for tables with a large number of 
> rows. For example - 
> 2013-12-17 19:08:03 IST [19893]: [791-1] user=myserrhpa,db=everest1 
> LOG:  duration: 0.093 ms  execute fetch from /pg8000_portal_10: 
> select * from myt 
> 2013-12-17 19:08:03 IST [19893]: [792-1] user=myserrhpa,db=everest1 
> LOG:  duration: 0.137 ms  execute fetch from /pg8000_portal_10: 
> select * from myt 
> 2013-12-17 19:08:03 IST [19893]: [793-1] user=myserrhpa,db=everest1 
> LOG:  duration: 0.093 ms  execute fetch from /pg8000_portal_10: 
> select * from myt 
> 2013-12-17 19:08:03 IST [19893]: [794-1] user=myserrhpa,db=everest1 
> LOG:  duration: 0.096 ms  execute fetch from /pg8000_portal_10: 
> select * from myt 
> 2013-12-17 19:08:03 IST [19893]: [795-1] user=myserrhpa,db=everest1 
> LOG:  duration: 0.063 ms  execute fetch from /pg8000_portal_10: 
> select * from myt 
> 2013-12-17 19:08:03 IST [19893]: [796-1] user=myserrhpa,db=everest1 
> LOG:  duration: 0.091 ms  execute fetch from /pg8000_portal_10: 
> select * from myt 
> 2013-12-17 19:08:03 IST [19893]: [797-1] user=myserrhpa,db=everest1 
> LOG:  duration: 0.064 ms  execute fetch from /pg8000_portal_10: 
> select * from myt 
> 2013-12-17 19:08:03 IST [19893]: [798-1] user=myserrhpa,db=everest1 
> LOG:  duration: 0.094 ms  execute fetch from /pg8000_portal_10: 
> select * from myt 
> 2013-12-17 19:08:03 IST [19893]: [799-1] user=myserrhpa,db=everest1 
> LOG:  duration: 0.068 ms  execute fetch from /pg8000_portal_10: 
> select * from myt 
> Is this normal? How can we control the number of fetches - some 
> parameter to set like array_size?
>


-- 
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/groups/opt_out.


[web2py] Re: Error accessing users in Instant Press

2013-12-17 Thread Alan Etkin
 
>
> Please how can we fix this Issue? 
>

There is a bug in modules/plugins/user.py

Go to line 149 and add db.auth_user.registration_key to the list assigned 
to fields.

-- 
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/groups/opt_out.


[web2py] web2py Jobs and meetups

2013-12-17 Thread Massimo Di Pierro
I am interested in knowing who are the web2py developers in Illinois and in 
California (possibly around San Francisco) for possible meet ups.

If you live near Chicago or near San Francisco, please email me.

If you do not leave in one of these places but you would be interested in 
moving to the US for a web2py job, also let me know.

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/groups/opt_out.


[web2py] Re: login crash under 2.8.2

2013-12-17 Thread Leonel Câmara
I'm still getting another problem if I store cookies in files as usual:

Traceback (most recent call last):
  File "C:\blueweb2py\gluon\main.py", line 479, in wsgibase
session._try_store_in_cookie_or_file(request, response)
  File "C:\blueweb2py\gluon\globals.py", line 1089, in 
_try_store_in_cookie_or_file
return self._try_store_in_file(request, response)
  File "C:\blueweb2py\gluon\globals.py", line 1096, in _try_store_in_file
or self._unchanged(response)):
  File "C:\blueweb2py\gluon\globals.py", line 1041, in _unchanged
session_pickled = cPickle.dumps(self)
  File "C:\Python27\Lib\copy_reg.py", line 70, in _reduce_ex
raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle lock objects


Which is definetely a bug since lock objects shouldn't be going into the 
session, or, if they are, session needs to have a __getstate__ that removes 
them. 

-- 
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/groups/opt_out.


[web2py] Re: error using auth.wiki('slug') on service pages

2013-12-17 Thread Alan Etkin

>
> Thanks for reply. In attachment you can see what I get on service pages 
> (_edit, _editmedia, _search...)
> Here presented is happening on wiki/default/index/_edit/index
>
> On _editmedia i get
> {'content': }
>
> On _search
> {'content': }
>
>
As a workaround you could try replacing the wiki(..) calls with 
wiki(...)["content"]. Anyway it seems that the output format for the wiki 
method has changed for different versions.

-- 
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/groups/opt_out.


[web2py] Re: LOAD only gives "Loading..." after upgrade

2013-12-17 Thread Brian M
OK, I've got a simple app that shows the behavior:

controllers/demo.py


# coding: utf8
# try something like
def index(): 
return dict(message="hello from demo.py")


def edit_loader():
loader = LOAD(f='edit_form', ajax=True)#change to ajax=False and form 
is shown in dialog
return dict(loader = loader)


def edit_form():
form = SQLFORM.factory(
   Field('first_name', 'text'),
   Field('last_name', 'text')
   )
return dict(form = form)

views/demo/index.html

{{extend 'layout.html'}}


{{if 'message' in globals():}}
{{=message}}


{{=T('How did you get here?')}}

  {{=T('You are successfully running web2py')}

{{elif 'content' in globals():}}
{{=content}}
{{else:}}
{{=BEAUTIFY(response._vars)}}
{{pass}}


open 
edit dialog




$(function() {
$("#edit_dialog").dialog({
width: 600,
height: 355,
modal: true,
autoOpen: false
});
//opens the dialog whenever one of the edit icons is clicked
$('a.updateDialog').on('click',  function(event) {
event.preventDefault();
//get url to load from the clicked link's href
var url = $(this).attr('href');


//tell jqueryUI to load the url & show it in the dialog
$('#edit_dialog').load(url, function() {
$('#edit_dialog').dialog('open');
});


});
});






views/demo/edit_loader.html


{{=loader}}

views/demo/edit_form.html
This is the default/edit_form.html template
{{=BEAUTIFY(response._vars)}}

Make sure you've got jQueryUI included somewhere in the page layout I just 
stuck it at the bottom of views/web2py_ajax.html




As far as the jGrowl part being displayed twice, it looks like changing my 
javascript ajax() call so that it does NOT include an ':eval' argument at 
the end fixed that.


On Tuesday, December 17, 2013 8:09:12 AM UTC-6, Anthony wrote:
>
> We probably need to see some code.
>
> On Tuesday, December 17, 2013 12:44:23 AM UTC-5, Brian M wrote:
>>
>> This would seem to be the same issue as 
>> https://groups.google.com/d/topic/web2py/kyEYmfQs6L0/discussion  but yet 
>> the solution offered there (make sure you've got the latest web2py.js) 
>> doesn't seem to be working for me. Oddly, I've got another form being 
>> loaded with LOAD(ajax=True) on the same page and that one works just fine.
>>
>> What I'm trying to do is have a datatable with "Edit" links next to each 
>> record. When the edit link is clicked on, a jQueryUI dialog is opened and 
>> the dialog is told to load the edit page for the chosen record which is 
>> done using javascript to build the appropriate URL for the chosen record 
>> and then a regular jquery .load() to fetch it into the dialog. The edit 
>> controller's view is then using web2py's LOAD() to insert the actual edit 
>> form with ajax=True so the edit form can be submitted without ever leaving 
>> the main page.  This was working perfectly in older web2py (v 2.4.x) but 
>> now when I try to finally upgrade to web2py v2.8.2 all I get within the 
>> dialog is "Loading..."  I've verified that my app has the latest 
>> static/js/web2py.js (and web2py_ajax.html, appadmin.py and appadmin.html) 
>> as outlined in the release/upgrade notes for v2.6.
>>
>> Anybody have ideas about what might be going wrong (or a better way to go 
>> about this)?
>>
>> Thanks
>> ~Brian
>>
>>

-- 
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/groups/opt_out.


[web2py] sqlstatements in tracebacks are quite short

2013-12-17 Thread Remco Boerma
Hi, 

Sometimes some errors are a little hard to debug because of the crammed 
representation in the tracebacks. Especially when something with the 
database goes wrong and you can't see the entire sql statement being fired. 
Insert this in your model and see more of the statement in the traceback. 

import pydoctextrepr = pydoc.TextRepr()textrepr.maxstring = textrepr.maxother = 
1000pydoc.text.repr = textrepr.repr


With kind regards, 
Remco Boerma



-- 
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/groups/opt_out.


Re: [web2py] Re: LOAD only gives "Loading..." after upgrade

2013-12-17 Thread Brian M
Chrome's JS Console isn't showing anything either. All it has is a note 
about "event.returnValue is deprecated. Please use the standard 
event.preventDefault() instead. " but that's coming from jquery.js itself 
(v1.10.2) and not my code so I don't think that's the cause.

I'm also noticing that a jGrowl message I've got being returned when the 
user checks a checkbox (it does a call back to the server) is being 
displayed twice so something else must have changed in web2py.js or 
elsewhere to cause that.

I'll try to see if I can make a fresh demo app to show this.

On Tuesday, December 17, 2013 6:26:14 AM UTC-6, Brian M wrote:
>
> Thanks Massimo I will give that a try. Was using firebug last night but 
> wasn't seeing any errors or anything.
> On Dec 17, 2013 12:53 AM, "Massimo Di Pierro"  
> wrote:
>
>> Try check with the google chrome js console. It should tell you what is 
>> going on.
>>
>> On Monday, 16 December 2013 23:44:23 UTC-6, Brian M wrote:
>>>
>>> This would seem to be the same issue as https://groups.google.com/d/
>>> topic/web2py/kyEYmfQs6L0/discussion  but yet the solution offered there 
>>> (make sure you've got the latest web2py.js) doesn't seem to be working for 
>>> me. Oddly, I've got another form being loaded with LOAD(ajax=True) on the 
>>> same page and that one works just fine.
>>>
>>> What I'm trying to do is have a datatable with "Edit" links next to each 
>>> record. When the edit link is clicked on, a jQueryUI dialog is opened and 
>>> the dialog is told to load the edit page for the chosen record which is 
>>> done using javascript to build the appropriate URL for the chosen record 
>>> and then a regular jquery .load() to fetch it into the dialog. The edit 
>>> controller's view is then using web2py's LOAD() to insert the actual edit 
>>> form with ajax=True so the edit form can be submitted without ever leaving 
>>> the main page.  This was working perfectly in older web2py (v 2.4.x) but 
>>> now when I try to finally upgrade to web2py v2.8.2 all I get within the 
>>> dialog is "Loading..."  I've verified that my app has the latest 
>>> static/js/web2py.js (and web2py_ajax.html, appadmin.py and appadmin.html) 
>>> as outlined in the release/upgrade notes for v2.6.
>>>
>>> Anybody have ideas about what might be going wrong (or a better way to 
>>> go about this)?
>>>
>>> Thanks
>>> ~Brian
>>>
>>>  -- 
>> 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/cQpjb-On7jY/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/groups/opt_out.
>>
>

-- 
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/groups/opt_out.


[web2py] Re: Error accessing users in Instant Press

2013-12-17 Thread Luis M Sanchez
Andrew W  writes:

> 
> 
> I logged that one, and I emailed Martin with details of a fix.Hoping to 
here from him. On Sunday, September 30, 2012 5:47:22 AM UTC+13, Jimi wrote:
> Never mind, I see now it's been logged as an issue.On Sunday, September 

Hello, It seems that this issue haven´t been resolved yet since 2012. 

I´ve just installed Instant Press the newer version, its a clean 
isntalation and I have the same problem, the ticket says:

 'Row' object has no attribute 
'registration_key'

Please how can we fix this Issue?

Thanks

23, 2012 11:17:49 AM UTC-4, Jimi wrote:
> New to web2py, so learning by looking at an app and taking it apart.  I 
pulled down the latest Instant Press and when accessing users, I'm getting 
the error: 'Row' object has no attribute 
'registration_key'
> I have not seen other references to this, so assume it's me, but I've 
tried various install combos (on Windows initally, then Ubuntu, package then 
source) all with same results.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/groups/opt_out.


[web2py] Re: Can't edit default.py after upgrade to 2.8.2

2013-12-17 Thread Paolo Valleri
logs should be placed in /var/log/apache2/ and /var/log/wsgi
can you also check if the string after alias_match 
in /etc/apache2/sites-available/default matches the one mentioned 
here: 
https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-ubuntu.sh#L148



Paolo



On Tuesday, December 17, 2013 3:08:17 PM UTC+1, Richard Brown wrote:
>
> Hi Paolo, there are no error messages in the Chrome Console, just a 
> 'cancelled' status against the file to be edited under the Network tab. The 
> details are in my posts  on Dec 10 in response to Massimo's question.
>
> I will try map_hyphen this evening - is this to be added to 'routes.py' as 
> described in one of jc's posts? If this was the problem wouldn't it either 
> work or not work consistently?
>
> Could you please explain where to find/how to view the Apache logs.
>
> Thanks, Richard
>
>

-- 
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/groups/opt_out.


[web2py] Re: we2py sql fetch

2013-12-17 Thread Jayadevan M
I did a pip install psycopg2. If it is there,web2py will use it by default? 
Now the repeat fetches have disappeared.

On Tuesday, December 17, 2013 7:58:26 PM UTC+5:30, Massimo Di Pierro wrote:
>
> What if you use psycopg2?
>
> Massimo
>
> On Tuesday, 17 December 2013 08:25:01 UTC-6, Jayadevan M wrote:
>>
>> No. The number of fetches go up when the number of records go up. It is a 
>> very simple test case. First I inserted 100 records. 
>> insert into myt (nm, title) select generate_series(1,100), 'A';
>>
>> There was just one fetch. Then I inserted many more 
>>  insert into myt (nm, title) select generate_series(100,10), 'A';
>>
>> If I see the log, it is like this . A parse, a bind, an execute, then all 
>> 'execute fetch'es.
>> 2013-12-17 19:07:57 IST [19893]: [23-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.577 ms  parse : select * from myt
>> 2013-12-17 19:07:57 IST [19893]: [24-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.420 ms  bind /pg8000_portal_10: select * from myt
>> 2013-12-17 19:07:57 IST [19893]: [25-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.148 ms  execute /pg8000_portal_10: select * from myt
>> 2013-12-17 19:07:57 IST [19893]: [26-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.151 ms  execute fetch from /pg8000_portal_10: select * 
>> from myt
>> 2013-12-17 19:07:58 IST [19893]: [27-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.116 ms  execute fetch from /pg8000_portal_10: select * 
>> from myt
>>
>> My test.py has just this 
>> def querytest():
>> sql="select * from myt "
>> rows=db.executesql(sql)
>> return dict(rows=rows)
>>
>> On Tuesday, December 17, 2013 7:46:45 PM UTC+5:30, Massimo Di Pierro 
>> wrote:
>>>
>>> You may have hidden recursive selects, for example in a represent 
>>> function.
>>>
>>> On Tuesday, 17 December 2013 07:41:47 UTC-6, Jayadevan M wrote:

 When I turned on logging for PostgreSQL during testing, I see that the 
 number of fetches goes up dramatically for tables with a large number of 
 rows. For example - 
 2013-12-17 19:08:03 IST [19893]: [791-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.093 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [792-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.137 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [793-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.093 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [794-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.096 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [795-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.063 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [796-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.091 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [797-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.064 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [798-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.094 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [799-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.068 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 Is this normal? How can we control the number of fetches - some 
 parameter to set like array_size?

>>>

-- 
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/groups/opt_out.


[web2py] Re: we2py sql fetch

2013-12-17 Thread Jayadevan M
I can try and get back. Any documentation link on how to make web2py use 
psycopg2? I am very much a web2py/pyhon newbee.

On Tuesday, December 17, 2013 7:58:26 PM UTC+5:30, Massimo Di Pierro wrote:
>
> What if you use psycopg2?
>
> Massimo
>
> On Tuesday, 17 December 2013 08:25:01 UTC-6, Jayadevan M wrote:
>>
>> No. The number of fetches go up when the number of records go up. It is a 
>> very simple test case. First I inserted 100 records. 
>> insert into myt (nm, title) select generate_series(1,100), 'A';
>>
>> There was just one fetch. Then I inserted many more 
>>  insert into myt (nm, title) select generate_series(100,10), 'A';
>>
>> If I see the log, it is like this . A parse, a bind, an execute, then all 
>> 'execute fetch'es.
>> 2013-12-17 19:07:57 IST [19893]: [23-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.577 ms  parse : select * from myt
>> 2013-12-17 19:07:57 IST [19893]: [24-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.420 ms  bind /pg8000_portal_10: select * from myt
>> 2013-12-17 19:07:57 IST [19893]: [25-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.148 ms  execute /pg8000_portal_10: select * from myt
>> 2013-12-17 19:07:57 IST [19893]: [26-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.151 ms  execute fetch from /pg8000_portal_10: select * 
>> from myt
>> 2013-12-17 19:07:58 IST [19893]: [27-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.116 ms  execute fetch from /pg8000_portal_10: select * 
>> from myt
>>
>> My test.py has just this 
>> def querytest():
>> sql="select * from myt "
>> rows=db.executesql(sql)
>> return dict(rows=rows)
>>
>> On Tuesday, December 17, 2013 7:46:45 PM UTC+5:30, Massimo Di Pierro 
>> wrote:
>>>
>>> You may have hidden recursive selects, for example in a represent 
>>> function.
>>>
>>> On Tuesday, 17 December 2013 07:41:47 UTC-6, Jayadevan M wrote:

 When I turned on logging for PostgreSQL during testing, I see that the 
 number of fetches goes up dramatically for tables with a large number of 
 rows. For example - 
 2013-12-17 19:08:03 IST [19893]: [791-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.093 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [792-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.137 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [793-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.093 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [794-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.096 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [795-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.063 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [796-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.091 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [797-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.064 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [798-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.094 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 2013-12-17 19:08:03 IST [19893]: [799-1] user=myserrhpa,db=everest1 
 LOG:  duration: 0.068 ms  execute fetch from /pg8000_portal_10: 
 select * from myt 
 Is this normal? How can we control the number of fetches - some 
 parameter to set like array_size?

>>>

-- 
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/groups/opt_out.


[web2py] Re: we2py sql fetch

2013-12-17 Thread Massimo Di Pierro
What if you use psycopg2?

Massimo

On Tuesday, 17 December 2013 08:25:01 UTC-6, Jayadevan M wrote:
>
> No. The number of fetches go up when the number of records go up. It is a 
> very simple test case. First I inserted 100 records. 
> insert into myt (nm, title) select generate_series(1,100), 'A';
>
> There was just one fetch. Then I inserted many more 
>  insert into myt (nm, title) select generate_series(100,10), 'A';
>
> If I see the log, it is like this . A parse, a bind, an execute, then all 
> 'execute fetch'es.
> 2013-12-17 19:07:57 IST [19893]: [23-1] user=myserrhpa,db=everest1 LOG:  
> duration: 0.577 ms  parse : select * from myt
> 2013-12-17 19:07:57 IST [19893]: [24-1] user=myserrhpa,db=everest1 LOG:  
> duration: 0.420 ms  bind /pg8000_portal_10: select * from myt
> 2013-12-17 19:07:57 IST [19893]: [25-1] user=myserrhpa,db=everest1 LOG:  
> duration: 0.148 ms  execute /pg8000_portal_10: select * from myt
> 2013-12-17 19:07:57 IST [19893]: [26-1] user=myserrhpa,db=everest1 LOG:  
> duration: 0.151 ms  execute fetch from /pg8000_portal_10: select * 
> from myt
> 2013-12-17 19:07:58 IST [19893]: [27-1] user=myserrhpa,db=everest1 LOG:  
> duration: 0.116 ms  execute fetch from /pg8000_portal_10: select * 
> from myt
>
> My test.py has just this 
> def querytest():
> sql="select * from myt "
> rows=db.executesql(sql)
> return dict(rows=rows)
>
> On Tuesday, December 17, 2013 7:46:45 PM UTC+5:30, Massimo Di Pierro wrote:
>>
>> You may have hidden recursive selects, for example in a represent 
>> function.
>>
>> On Tuesday, 17 December 2013 07:41:47 UTC-6, Jayadevan M wrote:
>>>
>>> When I turned on logging for PostgreSQL during testing, I see that the 
>>> number of fetches goes up dramatically for tables with a large number of 
>>> rows. For example - 
>>> 2013-12-17 19:08:03 IST [19893]: [791-1] user=myserrhpa,db=everest1 
>>> LOG:  duration: 0.093 ms  execute fetch from /pg8000_portal_10: 
>>> select * from myt 
>>> 2013-12-17 19:08:03 IST [19893]: [792-1] user=myserrhpa,db=everest1 
>>> LOG:  duration: 0.137 ms  execute fetch from /pg8000_portal_10: 
>>> select * from myt 
>>> 2013-12-17 19:08:03 IST [19893]: [793-1] user=myserrhpa,db=everest1 
>>> LOG:  duration: 0.093 ms  execute fetch from /pg8000_portal_10: 
>>> select * from myt 
>>> 2013-12-17 19:08:03 IST [19893]: [794-1] user=myserrhpa,db=everest1 
>>> LOG:  duration: 0.096 ms  execute fetch from /pg8000_portal_10: 
>>> select * from myt 
>>> 2013-12-17 19:08:03 IST [19893]: [795-1] user=myserrhpa,db=everest1 
>>> LOG:  duration: 0.063 ms  execute fetch from /pg8000_portal_10: 
>>> select * from myt 
>>> 2013-12-17 19:08:03 IST [19893]: [796-1] user=myserrhpa,db=everest1 
>>> LOG:  duration: 0.091 ms  execute fetch from /pg8000_portal_10: 
>>> select * from myt 
>>> 2013-12-17 19:08:03 IST [19893]: [797-1] user=myserrhpa,db=everest1 
>>> LOG:  duration: 0.064 ms  execute fetch from /pg8000_portal_10: 
>>> select * from myt 
>>> 2013-12-17 19:08:03 IST [19893]: [798-1] user=myserrhpa,db=everest1 
>>> LOG:  duration: 0.094 ms  execute fetch from /pg8000_portal_10: 
>>> select * from myt 
>>> 2013-12-17 19:08:03 IST [19893]: [799-1] user=myserrhpa,db=everest1 
>>> LOG:  duration: 0.068 ms  execute fetch from /pg8000_portal_10: 
>>> select * from myt 
>>> Is this normal? How can we control the number of fetches - some 
>>> parameter to set like array_size?
>>>
>>

-- 
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/groups/opt_out.


[web2py] Re: we2py sql fetch

2013-12-17 Thread Jayadevan M
No. The number of fetches go up when the number of records go up. It is a 
very simple test case. First I inserted 100 records. 
insert into myt (nm, title) select generate_series(1,100), 'A';

There was just one fetch. Then I inserted many more 
 insert into myt (nm, title) select generate_series(100,10), 'A';

If I see the log, it is like this . A parse, a bind, an execute, then all 
'execute fetch'es.
2013-12-17 19:07:57 IST [19893]: [23-1] user=myserrhpa,db=everest1 LOG:  
duration: 0.577 ms  parse : select * from myt
2013-12-17 19:07:57 IST [19893]: [24-1] user=myserrhpa,db=everest1 LOG:  
duration: 0.420 ms  bind /pg8000_portal_10: select * from myt
2013-12-17 19:07:57 IST [19893]: [25-1] user=myserrhpa,db=everest1 LOG:  
duration: 0.148 ms  execute /pg8000_portal_10: select * from myt
2013-12-17 19:07:57 IST [19893]: [26-1] user=myserrhpa,db=everest1 LOG:  
duration: 0.151 ms  execute fetch from /pg8000_portal_10: select * 
from myt
2013-12-17 19:07:58 IST [19893]: [27-1] user=myserrhpa,db=everest1 LOG:  
duration: 0.116 ms  execute fetch from /pg8000_portal_10: select * 
from myt

My test.py has just this 
ef querytest():
sql="select * from myt "
rows=db.executesql(sql)
return dict(rows=rows)

On Tuesday, December 17, 2013 7:46:45 PM UTC+5:30, Massimo Di Pierro wrote:
>
> You may have hidden recursive selects, for example in a represent function.
>
> On Tuesday, 17 December 2013 07:41:47 UTC-6, Jayadevan M wrote:
>>
>> When I turned on logging for PostgreSQL during testing, I see that the 
>> number of fetches goes up dramatically for tables with a large number of 
>> rows. For example - 
>> 2013-12-17 19:08:03 IST [19893]: [791-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.093 ms  execute fetch from /pg8000_portal_10: select * 
>> from myt 
>> 2013-12-17 19:08:03 IST [19893]: [792-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.137 ms  execute fetch from /pg8000_portal_10: select * 
>> from myt 
>> 2013-12-17 19:08:03 IST [19893]: [793-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.093 ms  execute fetch from /pg8000_portal_10: select * 
>> from myt 
>> 2013-12-17 19:08:03 IST [19893]: [794-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.096 ms  execute fetch from /pg8000_portal_10: select * 
>> from myt 
>> 2013-12-17 19:08:03 IST [19893]: [795-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.063 ms  execute fetch from /pg8000_portal_10: select * 
>> from myt 
>> 2013-12-17 19:08:03 IST [19893]: [796-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.091 ms  execute fetch from /pg8000_portal_10: select * 
>> from myt 
>> 2013-12-17 19:08:03 IST [19893]: [797-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.064 ms  execute fetch from /pg8000_portal_10: select * 
>> from myt 
>> 2013-12-17 19:08:03 IST [19893]: [798-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.094 ms  execute fetch from /pg8000_portal_10: select * 
>> from myt 
>> 2013-12-17 19:08:03 IST [19893]: [799-1] user=myserrhpa,db=everest1 LOG:  
>> duration: 0.068 ms  execute fetch from /pg8000_portal_10: select * 
>> from myt 
>> Is this normal? How can we control the number of fetches - some parameter 
>> to set like array_size?
>>
>

-- 
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/groups/opt_out.


[web2py] Re: we2py sql fetch

2013-12-17 Thread Massimo Di Pierro
You may have hidden recursive selects, for example in a represent function.

On Tuesday, 17 December 2013 07:41:47 UTC-6, Jayadevan M wrote:
>
> When I turned on logging for PostgreSQL during testing, I see that the 
> number of fetches goes up dramatically for tables with a large number of 
> rows. For example - 
> 2013-12-17 19:08:03 IST [19893]: [791-1] user=myserrhpa,db=everest1 LOG:  
> duration: 0.093 ms  execute fetch from /pg8000_portal_10: select * 
> from myt 
> 2013-12-17 19:08:03 IST [19893]: [792-1] user=myserrhpa,db=everest1 LOG:  
> duration: 0.137 ms  execute fetch from /pg8000_portal_10: select * 
> from myt 
> 2013-12-17 19:08:03 IST [19893]: [793-1] user=myserrhpa,db=everest1 LOG:  
> duration: 0.093 ms  execute fetch from /pg8000_portal_10: select * 
> from myt 
> 2013-12-17 19:08:03 IST [19893]: [794-1] user=myserrhpa,db=everest1 LOG:  
> duration: 0.096 ms  execute fetch from /pg8000_portal_10: select * 
> from myt 
> 2013-12-17 19:08:03 IST [19893]: [795-1] user=myserrhpa,db=everest1 LOG:  
> duration: 0.063 ms  execute fetch from /pg8000_portal_10: select * 
> from myt 
> 2013-12-17 19:08:03 IST [19893]: [796-1] user=myserrhpa,db=everest1 LOG:  
> duration: 0.091 ms  execute fetch from /pg8000_portal_10: select * 
> from myt 
> 2013-12-17 19:08:03 IST [19893]: [797-1] user=myserrhpa,db=everest1 LOG:  
> duration: 0.064 ms  execute fetch from /pg8000_portal_10: select * 
> from myt 
> 2013-12-17 19:08:03 IST [19893]: [798-1] user=myserrhpa,db=everest1 LOG:  
> duration: 0.094 ms  execute fetch from /pg8000_portal_10: select * 
> from myt 
> 2013-12-17 19:08:03 IST [19893]: [799-1] user=myserrhpa,db=everest1 LOG:  
> duration: 0.068 ms  execute fetch from /pg8000_portal_10: select * 
> from myt 
> Is this normal? How can we control the number of fetches - some parameter 
> to set like array_size?
>

-- 
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/groups/opt_out.


[web2py] Re: how to refer to other field in filter_in filter_out?

2013-12-17 Thread Anthony
If you're dealing with form submissions, you could get the value from 
request.post_vars.nome. Note, if you change the upload folder dynamically, 
you will also need a way to set it when you retrieve the file.

Anthony

On Tuesday, December 17, 2013 7:35:09 AM UTC-5, Ivan Gazzola wrote:
>
> db.define_table('files',
>Field('nome','reference Nomi',required=True, requires=[IS_IN_DB(db, 
> 'Nomi.id')]),
>Field('title', "string", unique=False,label="Descrizione"),
>Field('note'),   
>Field('immagine', 'upload', autodelete=True),
>Field('datecreated','datetime',default=now,readable=False),
>   
>  Field('data_file','date',label="Data",requires=IS_DATE(format=('%d/%m/%Y'
>
> I would like to set uploadfolder for immagine to ../data/nome.id  like 
> "../data/3"
>
> How can I access the values of the fields in the same row?
>
> Thx
>

-- 
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/groups/opt_out.


[web2py] Re: Can't edit default.py after upgrade to 2.8.2

2013-12-17 Thread Richard Brown


Hi Paolo, there are no error messages in the Chrome Console, just a 
'cancelled' status against the file to be edited under the Network tab. The 
details are in my posts  on Dec 10 in response to Massimo's question.

I will try map_hyphen this evening - is this to be added to 'routes.py' as 
described in one of jc's posts? If this was the problem wouldn't it either 
work or not work consistently?

Could you please explain where to find/how to view the Apache logs.

Thanks, Richard

-- 
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/groups/opt_out.


[web2py] Re: LOAD only gives "Loading..." after upgrade

2013-12-17 Thread Anthony
We probably need to see some code.

On Tuesday, December 17, 2013 12:44:23 AM UTC-5, Brian M wrote:
>
> This would seem to be the same issue as 
> https://groups.google.com/d/topic/web2py/kyEYmfQs6L0/discussion  but yet 
> the solution offered there (make sure you've got the latest web2py.js) 
> doesn't seem to be working for me. Oddly, I've got another form being 
> loaded with LOAD(ajax=True) on the same page and that one works just fine.
>
> What I'm trying to do is have a datatable with "Edit" links next to each 
> record. When the edit link is clicked on, a jQueryUI dialog is opened and 
> the dialog is told to load the edit page for the chosen record which is 
> done using javascript to build the appropriate URL for the chosen record 
> and then a regular jquery .load() to fetch it into the dialog. The edit 
> controller's view is then using web2py's LOAD() to insert the actual edit 
> form with ajax=True so the edit form can be submitted without ever leaving 
> the main page.  This was working perfectly in older web2py (v 2.4.x) but 
> now when I try to finally upgrade to web2py v2.8.2 all I get within the 
> dialog is "Loading..."  I've verified that my app has the latest 
> static/js/web2py.js (and web2py_ajax.html, appadmin.py and appadmin.html) 
> as outlined in the release/upgrade notes for v2.6.
>
> Anybody have ideas about what might be going wrong (or a better way to go 
> about this)?
>
> Thanks
> ~Brian
>
>

-- 
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/groups/opt_out.


[web2py] Re: Can't edit default.py after upgrade to 2.8.2

2013-12-17 Thread Leonel Câmara
BTW Richard, the scheduler db locking problems are to be expected if you're 
using sqlite, what you should do is to use one sqlite database for the 
scheduler and another for the rest of your app. 

-- 
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/groups/opt_out.


[web2py] we2py sql fetch

2013-12-17 Thread Jayadevan M
When I turned on logging for PostgreSQL during testing, I see that the 
number of fetches goes up dramatically for tables with a large number of 
rows. For example - 
2013-12-17 19:08:03 IST [19893]: [791-1] user=myserrhpa,db=everest1 LOG:  
duration: 0.093 ms  execute fetch from /pg8000_portal_10: select * 
from myt 
2013-12-17 19:08:03 IST [19893]: [792-1] user=myserrhpa,db=everest1 LOG:  
duration: 0.137 ms  execute fetch from /pg8000_portal_10: select * 
from myt 
2013-12-17 19:08:03 IST [19893]: [793-1] user=myserrhpa,db=everest1 LOG:  
duration: 0.093 ms  execute fetch from /pg8000_portal_10: select * 
from myt 
2013-12-17 19:08:03 IST [19893]: [794-1] user=myserrhpa,db=everest1 LOG:  
duration: 0.096 ms  execute fetch from /pg8000_portal_10: select * 
from myt 
2013-12-17 19:08:03 IST [19893]: [795-1] user=myserrhpa,db=everest1 LOG:  
duration: 0.063 ms  execute fetch from /pg8000_portal_10: select * 
from myt 
2013-12-17 19:08:03 IST [19893]: [796-1] user=myserrhpa,db=everest1 LOG:  
duration: 0.091 ms  execute fetch from /pg8000_portal_10: select * 
from myt 
2013-12-17 19:08:03 IST [19893]: [797-1] user=myserrhpa,db=everest1 LOG:  
duration: 0.064 ms  execute fetch from /pg8000_portal_10: select * 
from myt 
2013-12-17 19:08:03 IST [19893]: [798-1] user=myserrhpa,db=everest1 LOG:  
duration: 0.094 ms  execute fetch from /pg8000_portal_10: select * 
from myt 
2013-12-17 19:08:03 IST [19893]: [799-1] user=myserrhpa,db=everest1 LOG:  
duration: 0.068 ms  execute fetch from /pg8000_portal_10: select * 
from myt 
Is this normal? How can we control the number of fetches - some parameter 
to set like array_size?

-- 
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/groups/opt_out.


[web2py] Re: web2py ala static-site-generator

2013-12-17 Thread Massimo Di Pierro
I once made a static side generator that allows to create pages using the 
web2py template languages and or markmin (depending on the extension).

https://github.com/mdipierro/countach

It takes a tree structure of files, process them all, and creates a new 
tree structure. Pages can extend a parent template higher in the tree 
hierarchy.

I am sorry as of now this is undocumented.

Massimo

On Tuesday, 17 December 2013 03:27:54 UTC-6, Gour wrote:
>
> On Mon, 16 Dec 2013 13:46:22 -0800 (PST) 
> "Yassen D." > wrote: 
>
> > How about generating most of the pages and serving them as static 
> > content (e.g. templates that have nothing to render, just plain 
> > HTML); 
>
> Is there a way to generate such content offline, e.g. via xmlrpc or 
> something? 
>
> > then having some templates that really have stuff that needs 
> > to be rendered and processed (e.g. a contact form + a POST handler) ? 
>
> That part is probably clear and easy. 
>
>
> Sincerely, 
> Gour 
>
> -- 
> Many, many births both you and I have passed. I can remember 
> all of them, but you cannot, O subduer of the enemy! 
>
> http://www.atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 
>
>
>

-- 
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/groups/opt_out.


Re: [web2py] Re: Can't edit default.py after upgrade to 2.8.2

2013-12-17 Thread paolo.vall...@gmail.com
the editor requires several files, I'm just wondering if you get all of
them, can you check if there are error in Chrome console?
Moreover, please check apache logs, if something is not working there.
have you enabled map_hyphen ?

 Paolo


2013/12/17 Richard Brown 

> Hi Paolo, as a C programming, PC-using hardware engineer bumbling around
> in Linux-land I came across this sequence of commands:
>
> wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
> chmod +x setup-web2py-ubuntu.sh
> sudo ./setup-web2py-ubuntu.sh
>
> So whatever it does that is what I have installed. The webserver is
> Apache. I first ran this install a year or so ago and it was all working
> fine until I had some database locking problems when using the Scheduler so
> I tried to upgrade Web2py to see if it fixed it. However I kept getting
> tickets and couldn't work out what was wrong, so I reran the above
> commands, which presumably re-installed everything, and it all sprang into
> life - but with the file editing problem currently under discussion.
>
> The RPi is running Debian, but not the latest version as I didn't want to
> change anything that was working at the time. Maybe I should update now.
>
> Hope this helps, Richard.
>
>
>
>
> On Monday, 9 December 2013 22:04:31 UTC, Richard Brown wrote:
>
>> I am running Web2py on a Raspberry Pi and accessing the Admin
>> Interface via a browser on a Windows 8.1 PC. Since upgrading to the
>> latest version I can no longer edit default.py. When I try I get a 'blank'
>> edit screen with the 'Files Toggle', + A -' etc buttons at the top and the
>> 'Powered by Web2py' footer - but nothing in between. I can edit my Views,
>> db files and Modules, and I can peek default.py but always this blank
>> screen whenever I try to edit it. It is my longest file at just over 800
>> lines, but it worked fine before I upgraded.
>>
>> I have tried both IE and Chrome with the same results. Any ideas?
>>
>> Richard
>>
>  --
> 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/fIuUAqdSieQ/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/groups/opt_out.
>

-- 
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/groups/opt_out.


[web2py] Re: Can't edit default.py after upgrade to 2.8.2

2013-12-17 Thread Richard Brown
Hi Paolo, as a C programming, PC-using hardware engineer bumbling around in 
Linux-land I came across this sequence of commands:

wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
chmod +x setup-web2py-ubuntu.sh
sudo ./setup-web2py-ubuntu.sh

So whatever it does that is what I have installed. The webserver is Apache. 
I first ran this install a year or so ago and it was all working fine until 
I had some database locking problems when using the Scheduler so I tried to 
upgrade Web2py to see if it fixed it. However I kept getting tickets and 
couldn't work out what was wrong, so I reran the above commands, 
which presumably re-installed everything, and it all sprang into life - but 
with the file editing problem currently under discussion.

The RPi is running Debian, but not the latest version as I didn't want to 
change anything that was working at the time. Maybe I should update now.

Hope this helps, Richard.




On Monday, 9 December 2013 22:04:31 UTC, Richard Brown wrote:

> I am running Web2py on a Raspberry Pi and accessing the Admin 
> Interface via a browser on a Windows 8.1 PC. Since upgrading to the 
> latest version I can no longer edit default.py. When I try I get a 'blank' 
> edit screen with the 'Files Toggle', + A -' etc buttons at the top and the 
> 'Powered by Web2py' footer - but nothing in between. I can edit my Views, 
> db files and Modules, and I can peek default.py but always this blank 
> screen whenever I try to edit it. It is my longest file at just over 800 
> lines, but it worked fine before I upgraded.
>
> I have tried both IE and Chrome with the same results. Any ideas?
>
> Richard
>

-- 
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/groups/opt_out.


Re: [web2py] Re: Another multiple file upload and file drop area demo, this time using dropzone.js

2013-12-17 Thread Ruud Schroen
Ah! Very nice :)


On Tue, Dec 17, 2013 at 1:22 PM, Leonel Câmara wrote:

> Yes, all validators work since the usual SQLFORM form processing is always
> done. IS_IMAGE is actually demonstrated to work in this demo as we needed
> that to make the thumbnails.
>
> --
> 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/Em-oZbCWPNQ/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/groups/opt_out.
>

-- 
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/groups/opt_out.


[web2py] how to refer to other field in filter_in filter_out?

2013-12-17 Thread Ivan Gazzola
db.define_table('files',
   Field('nome','reference Nomi',required=True, requires=[IS_IN_DB(db, 
'Nomi.id')]),
   Field('title', "string", unique=False,label="Descrizione"),
   Field('note'),   
   Field('immagine', 'upload', autodelete=True),
   Field('datecreated','datetime',default=now,readable=False),
  
 Field('data_file','date',label="Data",requires=IS_DATE(format=('%d/%m/%Y'

I would like to set uploadfolder for immagine to ../data/nome.id  like 
"../data/3"

How can I access the values of the fields in the same row?

Thx

-- 
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/groups/opt_out.


Re: [web2py] Re: LOAD only gives "Loading..." after upgrade

2013-12-17 Thread Brian Meredyk
Thanks Massimo I will give that a try. Was using firebug last night but
wasn't seeing any errors or anything.
On Dec 17, 2013 12:53 AM, "Massimo Di Pierro" 
wrote:

> Try check with the google chrome js console. It should tell you what is
> going on.
>
> On Monday, 16 December 2013 23:44:23 UTC-6, Brian M wrote:
>>
>> This would seem to be the same issue as https://groups.google.com/d/
>> topic/web2py/kyEYmfQs6L0/discussion  but yet the solution offered there
>> (make sure you've got the latest web2py.js) doesn't seem to be working for
>> me. Oddly, I've got another form being loaded with LOAD(ajax=True) on the
>> same page and that one works just fine.
>>
>> What I'm trying to do is have a datatable with "Edit" links next to each
>> record. When the edit link is clicked on, a jQueryUI dialog is opened and
>> the dialog is told to load the edit page for the chosen record which is
>> done using javascript to build the appropriate URL for the chosen record
>> and then a regular jquery .load() to fetch it into the dialog. The edit
>> controller's view is then using web2py's LOAD() to insert the actual edit
>> form with ajax=True so the edit form can be submitted without ever leaving
>> the main page.  This was working perfectly in older web2py (v 2.4.x) but
>> now when I try to finally upgrade to web2py v2.8.2 all I get within the
>> dialog is "Loading..."  I've verified that my app has the latest
>> static/js/web2py.js (and web2py_ajax.html, appadmin.py and appadmin.html)
>> as outlined in the release/upgrade notes for v2.6.
>>
>> Anybody have ideas about what might be going wrong (or a better way to go
>> about this)?
>>
>> Thanks
>> ~Brian
>>
>>  --
> 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/cQpjb-On7jY/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/groups/opt_out.
>

-- 
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/groups/opt_out.


[web2py] Re: Another multiple file upload and file drop area demo, this time using dropzone.js

2013-12-17 Thread Leonel Câmara
Yes, all validators work since the usual SQLFORM form processing is always 
done. IS_IMAGE is actually demonstrated to work in this demo as we needed 
that to make the thumbnails.

-- 
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/groups/opt_out.


[web2py] Re: Another multiple file upload and file drop area demo, this time using dropzone.js

2013-12-17 Thread Ruud Schroen
Nice! I'll try it out later today!

Just one question, does the web2py validation also work on this? For 
example IS_IMAGE?

On Monday, December 16, 2013 7:21:01 PM UTC+1, Leonel Câmara wrote:
>
> I did this to see how I could integrate dropzone.js ( 
> http://www.dropzonejs.com/ )  with web2py as I'm thinking of using it in 
> some of my projects.
>
> Hopefuly it can be useful to someone else.
>
> In this demo you have:
> - drop files in an area of the page to upload them.
> - CSFR protection (if someone could validate it, that'd be great, I'm no 
> security expert).
> - Fallback html form working along side dropzone.
> - List files the user already uploaded, interact with them the same way 
> you do with files you have just uploaded.
> - Delete files.
> - Thumbnails.
> - Demonstration of how to compute filesize of an upload.
> - Uploads progress bar.
>
>
> Any comments, or bug reports, you guys may make are appreciated and 
> welcomed.
>

-- 
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/groups/opt_out.


[web2py] Re: error using auth.wiki('slug') on service pages

2013-12-17 Thread Janko Strusa
Thanks for reply. In attachment you can see what I get on service pages 
(_edit, _editmedia, _search...)
Here presented is happening on wiki/default/index/_edit/index

On _editmedia i get
{'content': }

On _search
{'content': }

As you can see, they are slightly different.

In earlier version (2.6.3) there was beside this error also a problem when 
submitting content. It just reloaded page. I did not check whether anything 
happened in background or was written in database, I just upgraded to 2.8.2.
Now I can submit content, but there is still that error when using 
auth.wiki('slug')

I have tried that patch you recommended, so downloaded source code, edited 
that line and run web2py.
Also I put {{=auth.wiki(slug="sidebar", force_render=True)}} in 
layout.html. But I get the same thing.

-- 
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/groups/opt_out.
<>

[web2py] how do I create, multiple forms and precess them, using 'for' statement?

2013-12-17 Thread Ivo
I want to create multiple forms with a 'for' statement and validate/process 
them.
the amount of forms to generate is dependent on a list containing user id's.
the list is dynamic; so I have a function generating a list, 'users', which 
contains: user:1L, user:4L, etc...
now I want to create a form for each of them and after 'submit' process 
them.

Normally I would just create a form in the controller like:
def show_form():
   form = SQLFORM.x()
   return dict(form=form)
and process it with:
   if form.accepts

however this would only generate one form... 
using:
def sow_form():
for user in users:
form = SQLFORM.x()
   return dict(form=form) 
and calling it from the view with {{=form}} doesn't work either because of 
'form' being static.

Creating the form from the view is a lot easier to do with:
{{for user in users:}}
(my form)
{{pass}}

but how do I process it?
I can give the form a unique name from the view with name="{{=user}}"
but then what?

The form is mostly prepopulated with vars created/calculated from the view 
but a part of those can be created/calculated from the controller. the form 
requires a uuid which needed in the processing of the form.

What is the best way to achieve this?
would:
def show_form():
for user in users:
form[user] = SQLFORM.x()
work? and how can I populate that form?

Please point me in the right direction.


-- 
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/groups/opt_out.


[web2py] Re: web2py ala static-site-generator

2013-12-17 Thread Gour
On Mon, 16 Dec 2013 13:46:22 -0800 (PST)
"Yassen D."  wrote:

> How about generating most of the pages and serving them as static
> content (e.g. templates that have nothing to render, just plain
> HTML); 

Is there a way to generate such content offline, e.g. via xmlrpc or
something?

> then having some templates that really have stuff that needs
> to be rendered and processed (e.g. a contact form + a POST handler) ?

That part is probably clear and easy.


Sincerely,
Gour

-- 
Many, many births both you and I have passed. I can remember 
all of them, but you cannot, O subduer of the enemy!

http://www.atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810


-- 
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/groups/opt_out.


Re: [web2py] Re: Can't edit default.py after upgrade to 2.8.2

2013-12-17 Thread paolo.vall...@gmail.com
Hi Richard,
which webserver are you using? Let us know more info about the
infrastructure you have build on the rpi


 Paolo


2013/12/16 Richard Brown 

> OK, to answer Paolo's question on Friday as to what had changed to make it
> not work at all - nothing, only the passage of time. So as an experiment I
> rebooted my RPi once again and behold it all sprang into life. I have
> rebooted several times since the Web2py upgrade and each time it works to
> some extent for a while, and then stops. I was then away until Sunday
> evening but it was still working when I tried it then, and so I was
> actually able to do some development work. However tonight when I logged in
> - nothing again. Not a single file at all will open for editing.
>
> Could this be some sort of timing (or timeout) problem rather than a hard
> 'bug'? File loading, when it does work, seems much slower than with the
> previous version. I've supplied some debug info in previous posts, but if
> there is anything else I can look at then please let me know.
>
>  --
> 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/fIuUAqdSieQ/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/groups/opt_out.
>

-- 
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/groups/opt_out.