Re: [web2py] Problems running with Cygwin

2014-04-16 Thread Kiran Subbaraman

  
  
python 2.7.x should be 32bit.
  cygwin use the 32bit installer.
  Since it is from source, you can run this as python ./web2py.py
  I just tried this on my Windows8 box, and this works. 
  
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
  On Wed, 16-04-2014 3:56 PM, Andre Basel wrote:


  I have been following: http://killer-web-development.com/section/2/5


As per the tutorial, I can get the following lines to work:

  curl -O http://www.web2py.com/examples<
span style="font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit;">/static/web2py_src.zip
$ unzip web2py_src.zip
$ cd web2py



However when I run the last line:
$ ./web2py.py
Nothing happens, I simply return to the $ prompt.


Any ideas 
 
  
  -- 
  Resources:
  - http://web2py.com
  - http://web2py.com/book
  (Documentation)
  - http://github.com/web2py/web2py
  (Source code)
  - https://code.google.com/p/web2py/issues/list
  (Report Issues)
  --- 
  You received this message because you are subscribed to the Google
  Groups "web2py-users" group.
  To unsubscribe from this group and stop receiving emails from it,
  send an email to web2py+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.


  




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Hosting separate web2py application and PHP application on same apache fedora server

2014-04-16 Thread LightDot
Browser could not find... means exactly that. That might not be an apache 
error at all...

If your domain / subdomain names are correct, than you're missing DNS 
entries for either caspdb or cleav subdomains. They might work locally if 
you've put them in /etc/hosts, but they most certainly won't resolve over 
the internet.

Before worrying about how your PHP is set up, you need to get to the point 
when your index.php is either executed or you see the text contents...

That being said, this is not really connected with web2py in any way.


On Thursday, April 17, 2014 2:57:11 AM UTC+2, sonu kumar wrote:
>
> When I open my catdb application on web it says browser could not find...
> there is one php.conf file in /etc/httpd/conf.d/
>
> my php application is totally independent of web2py application...
>
> On Wednesday, 16 April 2014 17:45:35 UTC-7, LightDot wrote:
>>
>> So what is the error you get? Apache should either complain at server 
>> restart or you should be able to see at least some error description when 
>> you attempt to open the page.
>>
>> Also, I assume you have PHP configured outside of this vhost and enabled 
>> server-wide? Are you using mod_fcgid or..?
>>
>>
>> On Thursday, April 17, 2014 2:36:48 AM UTC+2, sonu kumar wrote:
>>>
>>> I just corrected all typos and deleted "Deny from all" and also added
>>>
>>> ErrorLog /data/www/html/caspdb/error_log
>>>
>>> but still not working as well as nothing is written in error_log file
>>>
>>>
>>> On Wednesday, 16 April 2014 17:04:58 UTC-7, LightDot wrote:

 First thing that jumps at me is the "Deny from all" directive in your 
 PHP vhost... The other things I notice are the typos: you have catdb 
 subdomain, catpdb document root and caspdb directory. At least one of 
 those 
 is a clear typo.

 Apache logs are quite helpful with these stuff.

 Regards

 On Thursday, April 17, 2014 1:02:12 AM UTC+2, sonu kumar wrote:
>
> I am running one web2py application on fedora webserver. Now I would 
> like to run one PHP application on this same server, but I am not able to 
> configure its httpd.conf file.
>
> At the moment my web2py application setting in httpd.conf file is 
> below in black and red is for my PHP application but not able to access 
> PHP 
> application from web but web2py application running fine:
>
> NameVirtualHost *:80
> NameVirtualHost *:443
>
> 
>ServerName catdb.sanfordburnham.org
>DocumentRoot /data/www/html/catpdb
>
>
> AllowOverride None
> Order Allow,Deny
> Deny from all
> DirectoryIndex index.php
>   
>
> 
>
>
> 
>   ServerName cleav.sanfordburnham.org
>   WSGIDaemonProcess web2py user=apache group=apache processes=1 
> threads=1
>   WSGIProcessGroup web2py
>   WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py
>   WSGIPassAuthorization On
>
>   
> AllowOverride None
> Order Allow,Deny
> Deny from all
> 
>   Allow from all
> 
>   
>
>   AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
> /opt/web-apps/web2py/applications/$1/static/$2
>
>   
> Options -Indexes
> Order Allow,Deny
> Allow from all
>   
>
>   
> Deny from all
>   
>
>   
> Deny from all
>   
>
>   CustomLog /var/log/httpd/access_log common
>   ErrorLog /var/log/httpd/error_log
> 
>
> 
>   ServerName cleav.sanfordburnham.org
>   SSLEngine on
>   SSLCertificateFile /etc/httpd/ssl/self_signed.cert
>   SSLCertificateKeyFile /etc/httpd/ssl/self_signed.key
>
>   WSGIProcessGroup web2py
>   WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py
>   WSGIPassAuthorization On
>
>   
> AllowOverride None
> Order Allow,Deny
> Deny from all
> 
>   Allow from all
> 
>   
>
>   AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
> /opt/web-apps/web2py/applications/$1/static/$2
>
>   
> Options -Indexes
> ExpiresActive On
> ExpiresDefault "access plus 1 hour"
> Order Allow,Deny
> Allow from all
>   
>
>   CustomLog /var/log/httpd/access_log common
>   ErrorLog /var/log/httpd/error_log
> 
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Problems running with Cygwin

2014-04-16 Thread Dave S


On Wednesday, April 16, 2014 3:26:13 AM UTC-7, Andre Basel wrote:
>
> I have been following: http://killer-web-development.com/section/2/5
>
> As per the tutorial, I can get the following lines to work:
>
>> curl -O http://www.web2py.com/examples/static/web2py_src.zip
>> $ unzip web2py_src.zip
>> $ cd web2py
>>
>>
> However when I run the last line:
>
>> $ ./web2py.py
>
> Nothing happens, I simply return to the $ prompt.
>


What OS are you running on?  Do you have a version of Python already 
installed?

/dps
 

>
> Any ideas 
>
>>  
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Best way to implement SQL select query

2014-04-16 Thread Joe Barnhart
You probably want "belongs" instead of "contains".  It's a common mistake 
(which I make regularly myself).  The "contains" function in web2py is to 
test if strings are contained in a field, i.e. 
db.mytable.myfield.contains("joe") is like 
db.mytable.myfield.like("%joe%").  

"Belongs" is used to test for membership in a list, such as 
db.mytable.myfield.belongs([95050, 95051, 95052])

Hope this helps.

-- Joe

On Wednesday, April 16, 2014 5:39:02 AM UTC-7, Rob Goldsmith wrote:
>
> I tried posting this earlier, but it doesn't seem to have appeared yet - 
> so apologies if this comes up twice.
>
> I am writing a web2py application which accepts a UK postcode then 
> provides information about nearby postcodes. I have tried two methods, both 
> of which work fine when the number of nearby postcodes is relatively few 
> (less than a hundred).
>
> Method 1 uses the *contains *method as follows
>
> query &= db.t_properties.f_postcode.contains(result)
>
> where *result *is the list of nearby postcodes
>
> Method 2 does the query first and then uses *exclude* to eliminate the 
> unwanted rows as follows
>
> rows.exclude(lambda row: row.f_postcode not in result) 
>
> However, when the list of postcodes is larger (>about 100), both methods 
> are failing. Method 1 appears to fail because of inherent limitations of 
> sqlite (https://sqlite.org/limits.html - SQLITE_LIMIT_VARIABLE_NUMBER - 
> albeit that refers to a limit of 999 rather than 99). Method 2 fails with 
> the message:
>
>  maximum recursion depth exceeded in cmp
>
> Now, I'm pretty sure that I can solve it by moving to MySQL or another db 
> but I'm pretty sure that I'm not doing the query in the optimal way. Can 
> anyone give any advice as to the correct / most efficient way to accomplish 
> this?
>
> thanks 
> Rob.
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Hosting separate web2py application and PHP application on same apache fedora server

2014-04-16 Thread sonu kumar
When I open my catdb application on web it says browser could not find...
there is one php.conf file in /etc/httpd/conf.d/

my php application is totally independent of web2py application...

On Wednesday, 16 April 2014 17:45:35 UTC-7, LightDot wrote:
>
> So what is the error you get? Apache should either complain at server 
> restart or you should be able to see at least some error description when 
> you attempt to open the page.
>
> Also, I assume you have PHP configured outside of this vhost and enabled 
> server-wide? Are you using mod_fcgid or..?
>
>
> On Thursday, April 17, 2014 2:36:48 AM UTC+2, sonu kumar wrote:
>>
>> I just corrected all typos and deleted "Deny from all" and also added
>>
>> ErrorLog /data/www/html/caspdb/error_log
>>
>> but still not working as well as nothing is written in error_log file
>>
>>
>> On Wednesday, 16 April 2014 17:04:58 UTC-7, LightDot wrote:
>>>
>>> First thing that jumps at me is the "Deny from all" directive in your 
>>> PHP vhost... The other things I notice are the typos: you have catdb 
>>> subdomain, catpdb document root and caspdb directory. At least one of those 
>>> is a clear typo.
>>>
>>> Apache logs are quite helpful with these stuff.
>>>
>>> Regards
>>>
>>> On Thursday, April 17, 2014 1:02:12 AM UTC+2, sonu kumar wrote:

 I am running one web2py application on fedora webserver. Now I would 
 like to run one PHP application on this same server, but I am not able to 
 configure its httpd.conf file.

 At the moment my web2py application setting in httpd.conf file is below 
 in black and red is for my PHP application but not able to access PHP 
 application from web but web2py application running fine:

 NameVirtualHost *:80
 NameVirtualHost *:443

 
ServerName catdb.sanfordburnham.org
DocumentRoot /data/www/html/catpdb


 AllowOverride None
 Order Allow,Deny
 Deny from all
 DirectoryIndex index.php
   

 


 
   ServerName cleav.sanfordburnham.org
   WSGIDaemonProcess web2py user=apache group=apache processes=1 
 threads=1
   WSGIProcessGroup web2py
   WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py
   WSGIPassAuthorization On

   
 AllowOverride None
 Order Allow,Deny
 Deny from all
 
   Allow from all
 
   

   AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
 /opt/web-apps/web2py/applications/$1/static/$2

   
 Options -Indexes
 Order Allow,Deny
 Allow from all
   

   
 Deny from all
   

   
 Deny from all
   

   CustomLog /var/log/httpd/access_log common
   ErrorLog /var/log/httpd/error_log
 

 
   ServerName cleav.sanfordburnham.org
   SSLEngine on
   SSLCertificateFile /etc/httpd/ssl/self_signed.cert
   SSLCertificateKeyFile /etc/httpd/ssl/self_signed.key

   WSGIProcessGroup web2py
   WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py
   WSGIPassAuthorization On

   
 AllowOverride None
 Order Allow,Deny
 Deny from all
 
   Allow from all
 
   

   AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
 /opt/web-apps/web2py/applications/$1/static/$2

   
 Options -Indexes
 ExpiresActive On
 ExpiresDefault "access plus 1 hour"
 Order Allow,Deny
 Allow from all
   

   CustomLog /var/log/httpd/access_log common
   ErrorLog /var/log/httpd/error_log
 



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Hosting separate web2py application and PHP application on same apache fedora server

2014-04-16 Thread LightDot
So what is the error you get? Apache should either complain at server 
restart or you should be able to see at least some error description when 
you attempt to open the page.

Also, I assume you have PHP configured outside of this vhost and enabled 
server-wide? Are you using mod_fcgid or..?


On Thursday, April 17, 2014 2:36:48 AM UTC+2, sonu kumar wrote:
>
> I just corrected all typos and deleted "Deny from all" and also added
>
> ErrorLog /data/www/html/caspdb/error_log
>
> but still not working as well as nothing is written in error_log file
>
>
> On Wednesday, 16 April 2014 17:04:58 UTC-7, LightDot wrote:
>>
>> First thing that jumps at me is the "Deny from all" directive in your PHP 
>> vhost... The other things I notice are the typos: you have catdb subdomain, 
>> catpdb document root and caspdb directory. At least one of those is a clear 
>> typo.
>>
>> Apache logs are quite helpful with these stuff.
>>
>> Regards
>>
>> On Thursday, April 17, 2014 1:02:12 AM UTC+2, sonu kumar wrote:
>>>
>>> I am running one web2py application on fedora webserver. Now I would 
>>> like to run one PHP application on this same server, but I am not able to 
>>> configure its httpd.conf file.
>>>
>>> At the moment my web2py application setting in httpd.conf file is below 
>>> in black and red is for my PHP application but not able to access PHP 
>>> application from web but web2py application running fine:
>>>
>>> NameVirtualHost *:80
>>> NameVirtualHost *:443
>>>
>>> 
>>>ServerName catdb.sanfordburnham.org
>>>DocumentRoot /data/www/html/catpdb
>>>
>>>
>>> AllowOverride None
>>> Order Allow,Deny
>>> Deny from all
>>> DirectoryIndex index.php
>>>   
>>>
>>> 
>>>
>>>
>>> 
>>>   ServerName cleav.sanfordburnham.org
>>>   WSGIDaemonProcess web2py user=apache group=apache processes=1 threads=1
>>>   WSGIProcessGroup web2py
>>>   WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py
>>>   WSGIPassAuthorization On
>>>
>>>   
>>> AllowOverride None
>>> Order Allow,Deny
>>> Deny from all
>>> 
>>>   Allow from all
>>> 
>>>   
>>>
>>>   AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
>>> /opt/web-apps/web2py/applications/$1/static/$2
>>>
>>>   
>>> Options -Indexes
>>> Order Allow,Deny
>>> Allow from all
>>>   
>>>
>>>   
>>> Deny from all
>>>   
>>>
>>>   
>>> Deny from all
>>>   
>>>
>>>   CustomLog /var/log/httpd/access_log common
>>>   ErrorLog /var/log/httpd/error_log
>>> 
>>>
>>> 
>>>   ServerName cleav.sanfordburnham.org
>>>   SSLEngine on
>>>   SSLCertificateFile /etc/httpd/ssl/self_signed.cert
>>>   SSLCertificateKeyFile /etc/httpd/ssl/self_signed.key
>>>
>>>   WSGIProcessGroup web2py
>>>   WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py
>>>   WSGIPassAuthorization On
>>>
>>>   
>>> AllowOverride None
>>> Order Allow,Deny
>>> Deny from all
>>> 
>>>   Allow from all
>>> 
>>>   
>>>
>>>   AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
>>> /opt/web-apps/web2py/applications/$1/static/$2
>>>
>>>   
>>> Options -Indexes
>>> ExpiresActive On
>>> ExpiresDefault "access plus 1 hour"
>>> Order Allow,Deny
>>> Allow from all
>>>   
>>>
>>>   CustomLog /var/log/httpd/access_log common
>>>   ErrorLog /var/log/httpd/error_log
>>> 
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Hosting separate web2py application and PHP application on same apache fedora server

2014-04-16 Thread sonu kumar
I just corrected all typos and deleted "Deny from all" and also added

ErrorLog /data/www/html/caspdb/error_log

but still not working as well as nothing is written in error_log file


On Wednesday, 16 April 2014 17:04:58 UTC-7, LightDot wrote:
>
> First thing that jumps at me is the "Deny from all" directive in your PHP 
> vhost... The other things I notice are the typos: you have catdb subdomain, 
> catpdb document root and caspdb directory. At least one of those is a clear 
> typo.
>
> Apache logs are quite helpful with these stuff.
>
> Regards
>
> On Thursday, April 17, 2014 1:02:12 AM UTC+2, sonu kumar wrote:
>>
>> I am running one web2py application on fedora webserver. Now I would like 
>> to run one PHP application on this same server, but I am not able to 
>> configure its httpd.conf file.
>>
>> At the moment my web2py application setting in httpd.conf file is below 
>> in black and red is for my PHP application but not able to access PHP 
>> application from web but web2py application running fine:
>>
>> NameVirtualHost *:80
>> NameVirtualHost *:443
>>
>> 
>>ServerName catdb.sanfordburnham.org
>>DocumentRoot /data/www/html/catpdb
>>
>>
>> AllowOverride None
>> Order Allow,Deny
>> Deny from all
>> DirectoryIndex index.php
>>   
>>
>> 
>>
>>
>> 
>>   ServerName cleav.sanfordburnham.org
>>   WSGIDaemonProcess web2py user=apache group=apache processes=1 threads=1
>>   WSGIProcessGroup web2py
>>   WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py
>>   WSGIPassAuthorization On
>>
>>   
>> AllowOverride None
>> Order Allow,Deny
>> Deny from all
>> 
>>   Allow from all
>> 
>>   
>>
>>   AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
>> /opt/web-apps/web2py/applications/$1/static/$2
>>
>>   
>> Options -Indexes
>> Order Allow,Deny
>> Allow from all
>>   
>>
>>   
>> Deny from all
>>   
>>
>>   
>> Deny from all
>>   
>>
>>   CustomLog /var/log/httpd/access_log common
>>   ErrorLog /var/log/httpd/error_log
>> 
>>
>> 
>>   ServerName cleav.sanfordburnham.org
>>   SSLEngine on
>>   SSLCertificateFile /etc/httpd/ssl/self_signed.cert
>>   SSLCertificateKeyFile /etc/httpd/ssl/self_signed.key
>>
>>   WSGIProcessGroup web2py
>>   WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py
>>   WSGIPassAuthorization On
>>
>>   
>> AllowOverride None
>> Order Allow,Deny
>> Deny from all
>> 
>>   Allow from all
>> 
>>   
>>
>>   AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
>> /opt/web-apps/web2py/applications/$1/static/$2
>>
>>   
>> Options -Indexes
>> ExpiresActive On
>> ExpiresDefault "access plus 1 hour"
>> Order Allow,Deny
>> Allow from all
>>   
>>
>>   CustomLog /var/log/httpd/access_log common
>>   ErrorLog /var/log/httpd/error_log
>> 
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: T when sending email

2014-04-16 Thread Roberto Perdomo
Try something like this if you are using simple text email:

line1 = T('This is line one')
line2 = T('This is line two')
message = '%s\n%s' % (line1, line2)

mail.send(to='y...@example.com',
  subject='hello',
  # If reply_to is omitted, then mail.settings.sender is used
  reply_to='u...@example.com',
  message=message)

Here "\n" do the new line.

In HTML text email, use " instead of "\n"


2014-04-16 17:36 GMT-04:30 Kenneth :

>
>
> Hello,
>
> text
>
> send.mail()
>
>
> Kenneth
>
>
> what format are you sending the emails ? text or html ? What's the used
>> function to send the emails ?
>>
>> On Wednesday, April 16, 2014 2:20:02 PM UTC+2, Kenneth wrote:
>>>
>>> Hello,
>>>
>>> I'm trying to send email that is made from about 6-7 T('texts'). But
>>> newlines are not inserted into the emails.
>>>
>>> How should I do that?
>>>
>>>
>>> Kenneth
>>>
>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Hosting separate web2py application and PHP application on same apache fedora server

2014-04-16 Thread LightDot
First thing that jumps at me is the "Deny from all" directive in your PHP 
vhost... The other things I notice are the typos: you have catdb subdomain, 
catpdb document root and caspdb directory. At least one of those is a clear 
typo.

Apache logs are quite helpful with these stuff.

Regards

On Thursday, April 17, 2014 1:02:12 AM UTC+2, sonu kumar wrote:
>
> I am running one web2py application on fedora webserver. Now I would like 
> to run one PHP application on this same server, but I am not able to 
> configure its httpd.conf file.
>
> At the moment my web2py application setting in httpd.conf file is below in 
> black and red is for my PHP application but not able to access PHP 
> application from web but web2py application running fine:
>
> NameVirtualHost *:80
> NameVirtualHost *:443
>
> 
>ServerName catdb.sanfordburnham.org
>DocumentRoot /data/www/html/catpdb
>
>
> AllowOverride None
> Order Allow,Deny
> Deny from all
> DirectoryIndex index.php
>   
>
> 
>
>
> 
>   ServerName cleav.sanfordburnham.org
>   WSGIDaemonProcess web2py user=apache group=apache processes=1 threads=1
>   WSGIProcessGroup web2py
>   WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py
>   WSGIPassAuthorization On
>
>   
> AllowOverride None
> Order Allow,Deny
> Deny from all
> 
>   Allow from all
> 
>   
>
>   AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
> /opt/web-apps/web2py/applications/$1/static/$2
>
>   
> Options -Indexes
> Order Allow,Deny
> Allow from all
>   
>
>   
> Deny from all
>   
>
>   
> Deny from all
>   
>
>   CustomLog /var/log/httpd/access_log common
>   ErrorLog /var/log/httpd/error_log
> 
>
> 
>   ServerName cleav.sanfordburnham.org
>   SSLEngine on
>   SSLCertificateFile /etc/httpd/ssl/self_signed.cert
>   SSLCertificateKeyFile /etc/httpd/ssl/self_signed.key
>
>   WSGIProcessGroup web2py
>   WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py
>   WSGIPassAuthorization On
>
>   
> AllowOverride None
> Order Allow,Deny
> Deny from all
> 
>   Allow from all
> 
>   
>
>   AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
> /opt/web-apps/web2py/applications/$1/static/$2
>
>   
> Options -Indexes
> ExpiresActive On
> ExpiresDefault "access plus 1 hour"
> Order Allow,Deny
> Allow from all
>   
>
>   CustomLog /var/log/httpd/access_log common
>   ErrorLog /var/log/httpd/error_log
> 
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Hosting separate web2py application and PHP application on same apache fedora server

2014-04-16 Thread sonu kumar
I am running one web2py application on fedora webserver. Now I would like 
to run one PHP application on this same server, but I am not able to 
configure its httpd.conf file.

At the moment my web2py application setting in httpd.conf file is below in 
black and red is for my PHP application but not able to access PHP 
application from web but web2py application running fine:

NameVirtualHost *:80
NameVirtualHost *:443


   ServerName catdb.sanfordburnham.org
   DocumentRoot /data/www/html/catpdb

   
AllowOverride None
Order Allow,Deny
Deny from all
DirectoryIndex index.php
  





  ServerName cleav.sanfordburnham.org
  WSGIDaemonProcess web2py user=apache group=apache processes=1 threads=1
  WSGIProcessGroup web2py
  WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py
  WSGIPassAuthorization On

  
AllowOverride None
Order Allow,Deny
Deny from all

  Allow from all

  

  AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
/opt/web-apps/web2py/applications/$1/static/$2

  
Options -Indexes
Order Allow,Deny
Allow from all
  

  
Deny from all
  

  
Deny from all
  

  CustomLog /var/log/httpd/access_log common
  ErrorLog /var/log/httpd/error_log



  ServerName cleav.sanfordburnham.org
  SSLEngine on
  SSLCertificateFile /etc/httpd/ssl/self_signed.cert
  SSLCertificateKeyFile /etc/httpd/ssl/self_signed.key

  WSGIProcessGroup web2py
  WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py
  WSGIPassAuthorization On

  
AllowOverride None
Order Allow,Deny
Deny from all

  Allow from all

  

  AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
/opt/web-apps/web2py/applications/$1/static/$2

  
Options -Indexes
ExpiresActive On
ExpiresDefault "access plus 1 hour"
Order Allow,Deny
Allow from all
  

  CustomLog /var/log/httpd/access_log common
  ErrorLog /var/log/httpd/error_log


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: T when sending email

2014-04-16 Thread Kenneth


Hello,

text

send.mail()


Kenneth

what format are you sending the emails ? text or html ? What's the used 
> function to send the emails ?
>
> On Wednesday, April 16, 2014 2:20:02 PM UTC+2, Kenneth wrote:
>>
>> Hello,
>>
>> I'm trying to send email that is made from about 6-7 T('texts'). But 
>> newlines are not inserted into the emails. 
>>
>> How should I do that?
>>
>>
>> Kenneth
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] 'Table' object has no attribute 'attr'

2014-04-16 Thread Carlos Costa
The book says in
http://web2py.com/books/default/chapter/29/07/forms-and-validators
"causes the hidden fields to be passed with the submission, no more, no
less. form.accepts(...) is not intended to read the received hidden fields
and move them into form.vars. The reason is security. Hidden fields can be
tampered with. So you have to explicitly move hidden fields from the
request to the form:

form.vars.a = request.vars.a
"

So I think you do not have attr field in the table activity, do you?

If so, you should do something like that:

values=request.vars
del values['attr']
db(db.activity._id == request.vars['id']).update(**dict(values))





2014-04-16 13:36 GMT-03:00 Richard :

> I have used a form in a view and want to update a record after submit:
>
> View:
> {{=SQLFORM(db.activity, record = a.id, deletable = True,
> hidden=dict(attr='chgact'))}}
>
>
> controller:
>
> if (request.vars['attr'] == 'chgact') and
> (request.vars['delete_this_record'] != 'on'):
> db(db.activity._id ==
> request.vars['id']).update(**dict(request.vars))
>
> I use the convention in the controller because is is described in the
> manual in chapter 6:
>
> The update of record with given id can be done with:
> Inserting and updating from a dictionary
>
> A common issue consists of needing to insert or update records in a table
> where the name of the table, the field to be updated, and the value for the
> field are all stored in variables. For example: tablename, fieldname, and
> value.
>
> The insert can be done using the following syntax:
>
> db[tablename].insert(**{fieldname:value})
>
> The update of record with given id can be done with:
> db(db[tablename]._id==id).update(**{fieldname:value})
>
> Notice we used table._id instead of table.id. In this way the query works
> even for tables with a field of type "id" which has a name other than "id".
>
>
> What is going 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/d/optout.
>



-- 
Att.

Carlos J. Costa
Cientista da Computação
Esp. Gestão em Telecom

EL MELECH NEEMAN!
אָמֵן

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: id field is editable through REST PUT request

2014-04-16 Thread Henry Nguyen
Nice... thank you, Niphlod... I hadn't even considered checking that field 
attribute directly like that. 

Henry

On Wednesday, April 16, 2014 1:14:21 PM UTC-7, Niphlod wrote:
>
> it's not that far-fetch to include a control for writable = False 
> fields.
>
> def PUT(table_name, record_id, **vars):
> tb = db[table_name]
> cant_update_those = [tb[k] for k in tb.fields if tb[k].writable is 
> False]
> invalid_fields = set(vars) && set(cant_update_those)
> if invalid_fields:
> raise HTTP(400, 'whatever')
> return db(tb._id==record_id).validate_and_update(**vars)
>
> ask for more details if needed.
>
> On Wednesday, April 16, 2014 8:15:42 PM UTC+2, Henry Nguyen wrote:
>>
>> Simply inserting into the tables blindly was the problem, as Massimo 
>> pointed out. I've gone ahead and implemented manual checking of the vars:
>>
>> def PUT(*args, **vars):
>>
>> required_vars = ['id']
>> optional_vars = ['first_name','last_name']
>> 
>> # Check for required vars
>> for var in required_vars:
>> if var not in vars.keys():
>> raise HTTP(400, 'Missing:  ' + var)
>>
>> # Check that vars are only allowed vars
>> for key in vars.keys():
>> if key not in required_vars and key not in optional_vars:
>> raise HTTP(400, 'Invalid: ' + key)
>>
>> result = db(
>> (db.person.id == vars.get('id')) &
>> (db.person.auth_user_id == auth.user.id)
>> ).validate_and_update(**vars)
>>
>> return dict(result=result)
>>
>> I was hoping there'd be an easier way to specify validation constraints 
>> for the REST calls, similar to db.table.field.writable = False. 
>> Unfortunately, this only applies to the built-in SQLFORMs.
>>
>> Henry
>>
>> On Wednesday, April 16, 2014 11:06:42 AM UTC-7, Derek wrote:
>>>
>>> You're right, I guess you should store the ID in session state... but 
>>> wait, this is ReST... part of the url then, and not a parameter. and PUT 
>>> should not take the record_id.
>>>
>>> On Saturday, April 12, 2014 3:01:20 PM UTC-7, Massimo Di Pierro wrote:

 That is not a hole.

 This code:


 def PUT(table_name, record_id, **vars):
 return db(db[table_name]._id==record_id).validate_and_update(**
 vars)

 means:

 "allow anybody to put any content in any record of any table". If that 
 is not what you want you should write different code.

 On Friday, 11 April 2014 12:36:43 UTC-5, Derek wrote:
>
> That seems like a pretty big hole then especially if IDs are used as 
> foreign keys... ownership doesn't mean anything. I could write an 
> inflammatory comment on a website, change the owner to someone else (via 
> the edit form) and then suddenly that other user is banned...
>
> On Wednesday, April 9, 2014 2:03:53 PM UTC-7, Massimo Di Pierro wrote:
>>
>> > Does "db.person.id.writable = False" only apply to SQLFORMs?
>>
>> yes. 
>>
>> On Tuesday, 8 April 2014 18:31:54 UTC-5, Henry Nguyen wrote:
>>>
>>> Our product is using the @request.restful() decorator to specify 
>>> REST endpoints for our resources. During testing, I noticed that I can 
>>> specify a PUT request var of "id=x" where x is some new id and the id 
>>> of 
>>> that row will change to x. This is even WITH "db.table.id.writable = 
>>> False." 
>>>
>>> The PUT method is defined as follows:
>>>
>>> def PUT(table_name, record_id, **vars):
>>> return db(db[table_name]._id==record_id).validate_and_update
>>> (**vars)
>>>
>>> So, for example, on a db with "db.person.id.writable = False", a 
>>> request to "
>>> http://127.0.0.1:8000/appname/default/api/person/1?id=100"; will 
>>> modify the person row with id 1 to be id 100.
>>>
>>> This seems like a relatively major problem... if a user were to be 
>>> clever enough to play around with our UI and figure out the REST calls 
>>> being made, he/she could potentially mess with all the ids and 
>>> relationships of the resources, at least for that particular account 
>>> (and 
>>> any other resources we've exposed).
>>>
>>> Am I missing something? Does "db.person.id.writable = False" only 
>>> apply to SQLFORMs? Is there some other way to prevent modification of 
>>> the 
>>> id field?
>>>
>>> Thanks ahead of time for any help.
>>>
>>

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

[web2py] Re: T when sending email

2014-04-16 Thread Niphlod
what format are you sending the emails ? text or html ? What's the used 
function to send the emails ?

On Wednesday, April 16, 2014 2:20:02 PM UTC+2, Kenneth wrote:
>
> Hello,
>
> I'm trying to send email that is made from about 6-7 T('texts'). But 
> newlines are not inserted into the emails. 
>
> How should I do that?
>
>
> Kenneth
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Best way to implement SQL select query

2014-04-16 Thread Niphlod
what field type is f_postcode ?
what type is the result variable ?

On Wednesday, April 16, 2014 2:39:02 PM UTC+2, Rob Goldsmith wrote:
>
> I tried posting this earlier, but it doesn't seem to have appeared yet - 
> so apologies if this comes up twice.
>
> I am writing a web2py application which accepts a UK postcode then 
> provides information about nearby postcodes. I have tried two methods, both 
> of which work fine when the number of nearby postcodes is relatively few 
> (less than a hundred).
>
> Method 1 uses the *contains *method as follows
>
> query &= db.t_properties.f_postcode.contains(result)
>
> where *result *is the list of nearby postcodes
>
> Method 2 does the query first and then uses *exclude* to eliminate the 
> unwanted rows as follows
>
> rows.exclude(lambda row: row.f_postcode not in result) 
>
> However, when the list of postcodes is larger (>about 100), both methods 
> are failing. Method 1 appears to fail because of inherent limitations of 
> sqlite (https://sqlite.org/limits.html - SQLITE_LIMIT_VARIABLE_NUMBER - 
> albeit that refers to a limit of 999 rather than 99). Method 2 fails with 
> the message:
>
>  maximum recursion depth exceeded in cmp
>
> Now, I'm pretty sure that I can solve it by moving to MySQL or another db 
> but I'm pretty sure that I'm not doing the query in the optimal way. Can 
> anyone give any advice as to the correct / most efficient way to accomplish 
> this?
>
> thanks 
> Rob.
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Change the download text from "file" to something else?

2014-04-16 Thread Niphlod
what version are you using ?
with latest stable (2.9.5), I just confirmed that the string pops up quite 
fine.





Can you pack an app to reproduce ?

On Wednesday, April 16, 2014 4:23:06 PM UTC+2, Ramos wrote:
>
> a litle more info i use sqlform
>
> form=SQLFORM(db.trabalhador,row.id,
> showid=False,
> submit_button="Gravar",
> fields=formfields,
> table_name='trabalhador',
> formstyle = 'table2cols',
> upload=URL('download'),
> readonly=readonly
> )
>
>  to create the form and in my view i have only {{=form}}
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: id field is editable through REST PUT request

2014-04-16 Thread Niphlod
it's not that far-fetch to include a control for writable = False 
fields.

def PUT(table_name, record_id, **vars):
tb = db[table_name]
cant_update_those = [tb[k] for k in tb.fields if tb[k].writable is 
False]
invalid_fields = set(vars) && set(cant_update_those)
if invalid_fields:
raise HTTP(400, 'whatever')
return db(tb._id==record_id).validate_and_update(**vars)

ask for more details if needed.

On Wednesday, April 16, 2014 8:15:42 PM UTC+2, Henry Nguyen wrote:
>
> Simply inserting into the tables blindly was the problem, as Massimo 
> pointed out. I've gone ahead and implemented manual checking of the vars:
>
> def PUT(*args, **vars):
>
> required_vars = ['id']
> optional_vars = ['first_name','last_name']
> 
> # Check for required vars
> for var in required_vars:
> if var not in vars.keys():
> raise HTTP(400, 'Missing:  ' + var)
>
> # Check that vars are only allowed vars
> for key in vars.keys():
> if key not in required_vars and key not in optional_vars:
> raise HTTP(400, 'Invalid: ' + key)
>
> result = db(
> (db.person.id == vars.get('id')) &
> (db.person.auth_user_id == auth.user.id)
> ).validate_and_update(**vars)
>
> return dict(result=result)
>
> I was hoping there'd be an easier way to specify validation constraints 
> for the REST calls, similar to db.table.field.writable = False. 
> Unfortunately, this only applies to the built-in SQLFORMs.
>
> Henry
>
> On Wednesday, April 16, 2014 11:06:42 AM UTC-7, Derek wrote:
>>
>> You're right, I guess you should store the ID in session state... but 
>> wait, this is ReST... part of the url then, and not a parameter. and PUT 
>> should not take the record_id.
>>
>> On Saturday, April 12, 2014 3:01:20 PM UTC-7, Massimo Di Pierro wrote:
>>>
>>> That is not a hole.
>>>
>>> This code:
>>>
>>>
>>> def PUT(table_name, record_id, **vars):
>>> return db(db[table_name]._id==record_id).validate_and_update(**
>>> vars)
>>>
>>> means:
>>>
>>> "allow anybody to put any content in any record of any table". If that 
>>> is not what you want you should write different code.
>>>
>>> On Friday, 11 April 2014 12:36:43 UTC-5, Derek wrote:

 That seems like a pretty big hole then especially if IDs are used as 
 foreign keys... ownership doesn't mean anything. I could write an 
 inflammatory comment on a website, change the owner to someone else (via 
 the edit form) and then suddenly that other user is banned...

 On Wednesday, April 9, 2014 2:03:53 PM UTC-7, Massimo Di Pierro wrote:
>
> > Does "db.person.id.writable = False" only apply to SQLFORMs?
>
> yes. 
>
> On Tuesday, 8 April 2014 18:31:54 UTC-5, Henry Nguyen wrote:
>>
>> Our product is using the @request.restful() decorator to specify REST 
>> endpoints for our resources. During testing, I noticed that I can 
>> specify a 
>> PUT request var of "id=x" where x is some new id and the id of that row 
>> will change to x. This is even WITH "db.table.id.writable = False." 
>>
>> The PUT method is defined as follows:
>>
>> def PUT(table_name, record_id, **vars):
>> return db(db[table_name]._id==record_id).validate_and_update
>> (**vars)
>>
>> So, for example, on a db with "db.person.id.writable = False", a 
>> request to "http://127.0.0.1:8000/appname/default/api/person/1?id=100"; 
>> will modify the person row with id 1 to be id 100.
>>
>> This seems like a relatively major problem... if a user were to be 
>> clever enough to play around with our UI and figure out the REST calls 
>> being made, he/she could potentially mess with all the ids and 
>> relationships of the resources, at least for that particular account 
>> (and 
>> any other resources we've exposed).
>>
>> Am I missing something? Does "db.person.id.writable = False" only 
>> apply to SQLFORMs? Is there some other way to prevent modification of 
>> the 
>> id field?
>>
>> Thanks ahead of time for any help.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Most efficient way to do SQL select with condition constrained by a list

2014-04-16 Thread Rob Goldsmith
Hi
I'm writing a web2py application that starts with a UK postcode and then 
retrieves information for surrounding UK postcodes. I have tried two 
methods of doing this - both of which work fine when the surrounding search 
area is relatively small (i.e. when there are few extra postcodes).

Method 1: added

db.t_properties.f_postcode.contains(result)

to the database query, where *result *contains a list of postcodes.

Method 2:

Ran the database query without the *contains* condition, and subsequently 
ran 

rows.exclude(lambda row: row.f_postcode not in result)

However, when the search area increased to more than a couple of hundred 
results, I got results from both errors. A bit of googling revealed that 
Method 1 is constrained by the maximum number of conditions that you can 
search on in SQLite. Method 2 failed with the following message:

 maximum recursion depth exceeded in cmp

Now, I'm pretty certain that I could fix the error by moving to MySQL or 
another db, but I think I may not be approaching the query in the "correct" 
/ most efficient way. Does anyone have any suggestions of the best way to 
proceed?

thanks

Rob

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Best way to implement SQL select query

2014-04-16 Thread Rob Goldsmith
I tried posting this earlier, but it doesn't seem to have appeared yet - so 
apologies if this comes up twice.

I am writing a web2py application which accepts a UK postcode then provides 
information about nearby postcodes. I have tried two methods, both of which 
work fine when the number of nearby postcodes is relatively few (less than 
a hundred).

Method 1 uses the *contains *method as follows

query &= db.t_properties.f_postcode.contains(result)

where *result *is the list of nearby postcodes

Method 2 does the query first and then uses *exclude* to eliminate the 
unwanted rows as follows

rows.exclude(lambda row: row.f_postcode not in result) 

However, when the list of postcodes is larger (>about 100), both methods 
are failing. Method 1 appears to fail because of inherent limitations of 
sqlite (https://sqlite.org/limits.html - SQLITE_LIMIT_VARIABLE_NUMBER - 
albeit that refers to a limit of 999 rather than 99). Method 2 fails with 
the message:

 maximum recursion depth exceeded in cmp

Now, I'm pretty sure that I can solve it by moving to MySQL or another db 
but I'm pretty sure that I'm not doing the query in the optimal way. Can 
anyone give any advice as to the correct / most efficient way to accomplish 
this?

thanks 
Rob.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Problems running with Cygwin

2014-04-16 Thread Andre Basel
I have been following: http://killer-web-development.com/section/2/5

As per the tutorial, I can get the following lines to work:

> curl -O http://www.web2py.com/examples/static/web2py_src.zip
> $ unzip web2py_src.zip
> $ cd web2py
>
>
However when I run the last line:

> $ ./web2py.py

Nothing happens, I simply return to the $ prompt.

Any ideas 

>  

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] 'auth.settings.register_verify_password = True' does not generate password confirmation field

2014-04-16 Thread Spokes
I am writing a custom registration form, and would like the form to contain 
a field in which the user has to re-enter/confirm the password they want. 
The new user() function contains the following lines:

def user(): 
if request.args(0) == 'login':
return dict(form = auth())
else: 
form_user = SQLFORM(db.auth_user)

if form_user.process().accepted:
pass

return dict(form=form_user)

The registration form that's generated does not contain a field to confirm 
the password.

I've set 'auth.settings.register_verify_password' to True in my db.py file 
(generated by the wizard), but it does not seem to have any effect. How can 
I make the password confirmation field appear as part of the form? Thank 
you.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: id field is editable through REST PUT request

2014-04-16 Thread Henry Nguyen
Simply inserting into the tables blindly was the problem, as Massimo 
pointed out. I've gone ahead and implemented manual checking of the vars:

def PUT(*args, **vars):

required_vars = ['id']
optional_vars = ['first_name','last_name']

# Check for required vars
for var in required_vars:
if var not in vars.keys():
raise HTTP(400, 'Missing:  ' + var)

# Check that vars are only allowed vars
for key in vars.keys():
if key not in required_vars and key not in optional_vars:
raise HTTP(400, 'Invalid: ' + key)

result = db(
(db.person.id == vars.get('id')) &
(db.person.auth_user_id == auth.user.id)
).validate_and_update(**vars)

return dict(result=result)

I was hoping there'd be an easier way to specify validation constraints for 
the REST calls, similar to db.table.field.writable = False. Unfortunately, 
this only applies to the built-in SQLFORMs.

Henry

On Wednesday, April 16, 2014 11:06:42 AM UTC-7, Derek wrote:
>
> You're right, I guess you should store the ID in session state... but 
> wait, this is ReST... part of the url then, and not a parameter. and PUT 
> should not take the record_id.
>
> On Saturday, April 12, 2014 3:01:20 PM UTC-7, Massimo Di Pierro wrote:
>>
>> That is not a hole.
>>
>> This code:
>>
>>
>> def PUT(table_name, record_id, **vars):
>> return db(db[table_name]._id==record_id).validate_and_update(**
>> vars)
>>
>> means:
>>
>> "allow anybody to put any content in any record of any table". If that is 
>> not what you want you should write different code.
>>
>> On Friday, 11 April 2014 12:36:43 UTC-5, Derek wrote:
>>>
>>> That seems like a pretty big hole then especially if IDs are used as 
>>> foreign keys... ownership doesn't mean anything. I could write an 
>>> inflammatory comment on a website, change the owner to someone else (via 
>>> the edit form) and then suddenly that other user is banned...
>>>
>>> On Wednesday, April 9, 2014 2:03:53 PM UTC-7, Massimo Di Pierro wrote:

 > Does "db.person.id.writable = False" only apply to SQLFORMs?

 yes. 

 On Tuesday, 8 April 2014 18:31:54 UTC-5, Henry Nguyen wrote:
>
> Our product is using the @request.restful() decorator to specify REST 
> endpoints for our resources. During testing, I noticed that I can specify 
> a 
> PUT request var of "id=x" where x is some new id and the id of that row 
> will change to x. This is even WITH "db.table.id.writable = False." 
>
> The PUT method is defined as follows:
>
> def PUT(table_name, record_id, **vars):
> return db(db[table_name]._id==record_id).validate_and_update
> (**vars)
>
> So, for example, on a db with "db.person.id.writable = False", a 
> request to "http://127.0.0.1:8000/appname/default/api/person/1?id=100"; 
> will modify the person row with id 1 to be id 100.
>
> This seems like a relatively major problem... if a user were to be 
> clever enough to play around with our UI and figure out the REST calls 
> being made, he/she could potentially mess with all the ids and 
> relationships of the resources, at least for that particular account (and 
> any other resources we've exposed).
>
> Am I missing something? Does "db.person.id.writable = False" only 
> apply to SQLFORMs? Is there some other way to prevent modification of the 
> id field?
>
> Thanks ahead of time for any help.
>


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: SQLFORM.grid Export and represent

2014-04-16 Thread John Fraser
The problem is I need the values 'as displayed to the user'  for all
referenced fields. So I  need the represent value for some fields and do
not for others.

I was over thinking the problem and Cliff pointed me in the right
directionThanks as this appears to work.  Vars not Args

if '_export_type' not in request.vars:
db.inventory.cpu_status.represent = lambda cpu_status, row: \
SPAN(row.cpu_status,
 _style='text-transform: uppercase; font-weight: bold;
padding:5px; color: %s; background-color: %s' %
 ('black' if row.cpu_status == 'Staged' else 'white','red'
if row.cpu_status == 'Repair' else 'gold'
 if row.cpu_status == 'Staged' else 'green' if
row.cpu_status == 'In Use' else 'black'))





On Wed, Apr 16, 2014 at 1:35 PM, Anthony  wrote:

> Also, I believe CSV does not use the represent attribute (i.e., it returns
> the raw values) -- only TSV converts the values via represent. So, maybe
> just disable TSV.
>
> Anthony
>
>
> On Wednesday, April 16, 2014 1:29:30 PM UTC-4, Cliff Kachinske wrote:
>
>> There must be something in the request that indicates you want csv or tsv.
>>
>> If it's in the request.args, for example, something like this would work:
>>
>> if 'csv' not in request.args and 'tsv' not in request.args:
>> db.inventory.cpu_status.represent = lambda cpu_status, row: SPAN(
>>...
>>
>> On Wednesday, April 16, 2014 12:58:12 PM UTC-4, John Fraser wrote:
>>>
>>> Is there an easy way to strip HTML markup from SQLFORM.grid's CSV/TSV
>>> export?  I realize I probably need to create a custom export function, but
>>> curious if there is an argument or a one liner that would do the trick.  Or
>>> is there a better way to format the display?
>>>
>>> I have the following controller function:
>>>
>>> @auth.requires_login()
>>> def index():
>>> response.title = 'Computer Inventory'
>>> db.inventory.id.readable = False
>>> db.inventory.cpu_status.represent = lambda cpu_status, row: \
>>> SPAN(row.cpu_status,
>>>  _style='text-transform: uppercase; font-weight: bold;
>>> padding:5px; color: %s; background-color: %s' %
>>>  ('black' if row.cpu_status == 'Staged' else 'white','red'
>>> if row.cpu_status == 'Repair' else 'gold'
>>>  if row.cpu_status == 'Staged' else 'green' if
>>> row.cpu_status == 'In Use' else 'black'))
>>> grid = SQLFORM.grid(db.inventory, csv=True)
>>> return locals()
>>>
>>>
>>> When I export as CSV/TSV (as displayed to the user) all values for
>>> db.inventory.cpu_status are wrapped in SPAN tags for example:
>>>
>>> VALUE
>>>
>>>
>>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/q7IC4wo_BE0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: id field is editable through REST PUT request

2014-04-16 Thread Derek
You're right, I guess you should store the ID in session state... but wait, 
this is ReST... part of the url then, and not a parameter. and PUT should 
not take the record_id.

On Saturday, April 12, 2014 3:01:20 PM UTC-7, Massimo Di Pierro wrote:
>
> That is not a hole.
>
> This code:
>
>
> def PUT(table_name, record_id, **vars):
> return db(db[table_name]._id==record_id).validate_and_update(**
> vars)
>
> means:
>
> "allow anybody to put any content in any record of any table". If that is 
> not what you want you should write different code.
>
> On Friday, 11 April 2014 12:36:43 UTC-5, Derek wrote:
>>
>> That seems like a pretty big hole then especially if IDs are used as 
>> foreign keys... ownership doesn't mean anything. I could write an 
>> inflammatory comment on a website, change the owner to someone else (via 
>> the edit form) and then suddenly that other user is banned...
>>
>> On Wednesday, April 9, 2014 2:03:53 PM UTC-7, Massimo Di Pierro wrote:
>>>
>>> > Does "db.person.id.writable = False" only apply to SQLFORMs?
>>>
>>> yes. 
>>>
>>> On Tuesday, 8 April 2014 18:31:54 UTC-5, Henry Nguyen wrote:

 Our product is using the @request.restful() decorator to specify REST 
 endpoints for our resources. During testing, I noticed that I can specify 
 a 
 PUT request var of "id=x" where x is some new id and the id of that row 
 will change to x. This is even WITH "db.table.id.writable = False." 

 The PUT method is defined as follows:

 def PUT(table_name, record_id, **vars):
 return db(db[table_name]._id==record_id).validate_and_update(**
 vars)

 So, for example, on a db with "db.person.id.writable = False", a 
 request to "http://127.0.0.1:8000/appname/default/api/person/1?id=100"; 
 will modify the person row with id 1 to be id 100.

 This seems like a relatively major problem... if a user were to be 
 clever enough to play around with our UI and figure out the REST calls 
 being made, he/she could potentially mess with all the ids and 
 relationships of the resources, at least for that particular account (and 
 any other resources we've exposed).

 Am I missing something? Does "db.person.id.writable = False" only apply 
 to SQLFORMs? Is there some other way to prevent modification of the id 
 field?

 Thanks ahead of time for any help.

>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLFORM.grid Export and represent

2014-04-16 Thread Anthony
Also, I believe CSV does not use the represent attribute (i.e., it returns 
the raw values) -- only TSV converts the values via represent. So, maybe 
just disable TSV.

Anthony

On Wednesday, April 16, 2014 1:29:30 PM UTC-4, Cliff Kachinske wrote:

> There must be something in the request that indicates you want csv or tsv.
>
> If it's in the request.args, for example, something like this would work:
>
> if 'csv' not in request.args and 'tsv' not in request.args:
> db.inventory.cpu_status.represent = lambda cpu_status, row: SPAN(
>...
>
> On Wednesday, April 16, 2014 12:58:12 PM UTC-4, John Fraser wrote:
>>
>> Is there an easy way to strip HTML markup from SQLFORM.grid's CSV/TSV 
>> export?  I realize I probably need to create a custom export function, but 
>> curious if there is an argument or a one liner that would do the trick.  Or 
>> is there a better way to format the display?
>>
>> I have the following controller function:
>>
>> @auth.requires_login()
>> def index():
>> response.title = 'Computer Inventory'
>> db.inventory.id.readable = False
>> db.inventory.cpu_status.represent = lambda cpu_status, row: \
>> SPAN(row.cpu_status,
>>  _style='text-transform: uppercase; font-weight: bold; 
>> padding:5px; color: %s; background-color: %s' %
>>  ('black' if row.cpu_status == 'Staged' else 'white','red' if 
>> row.cpu_status == 'Repair' else 'gold'
>>  if row.cpu_status == 'Staged' else 'green' if row.cpu_status 
>> == 'In Use' else 'black'))
>> grid = SQLFORM.grid(db.inventory, csv=True)
>> return locals()
>>
>>
>> When I export as CSV/TSV (as displayed to the user) all values for 
>> db.inventory.cpu_status are wrapped in SPAN tags for example:
>>
>> VALUE
>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLFORM.grid Export and represent

2014-04-16 Thread Cliff Kachinske
There must be something in the request that indicates you want csv or tsv.

If it's in the request.args, for example, something like this would work:

if 'csv' not in request.args and 'tsv' not in request.args:
db.inventory.cpu_status.represent = lambda cpu_status, row: SPAN(
   ...

On Wednesday, April 16, 2014 12:58:12 PM UTC-4, John Fraser wrote:
>
> Is there an easy way to strip HTML markup from SQLFORM.grid's CSV/TSV 
> export?  I realize I probably need to create a custom export function, but 
> curious if there is an argument or a one liner that would do the trick.  Or 
> is there a better way to format the display?
>
> I have the following controller function:
>
> @auth.requires_login()
> def index():
> response.title = 'Computer Inventory'
> db.inventory.id.readable = False
> db.inventory.cpu_status.represent = lambda cpu_status, row: \
> SPAN(row.cpu_status,
>  _style='text-transform: uppercase; font-weight: bold; 
> padding:5px; color: %s; background-color: %s' %
>  ('black' if row.cpu_status == 'Staged' else 'white','red' if 
> row.cpu_status == 'Repair' else 'gold'
>  if row.cpu_status == 'Staged' else 'green' if row.cpu_status 
> == 'In Use' else 'black'))
> grid = SQLFORM.grid(db.inventory, csv=True)
> return locals()
>
>
> When I export as CSV/TSV (as displayed to the user) all values for 
> db.inventory.cpu_status are wrapped in SPAN tags for example:
>
> VALUE
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] routes.py invalid request

2014-04-16 Thread Cliff Kachinske
Using pattern-based routing, I get Invalid Request messages. 

Usually the routes work OK after restarting nginx. But after closing and 
restarting Chrome the problem recurs.

The failing url is www.dotzle.com/apps

This is the routes.py file.

I used the nginx setup script. The only change I made was to increase the 
upload file size to 5 meg in /etc/nginx/nginx.conf.

Later today I will try this with rocket and see if the problem goes away.

Thanks for any help.

 
BASE = ''  # optonal prefix for incoming URLs
 34 
 35 routes_in = (
 36 # do not reroute admin unless you want to disable it
 37 (BASE + '/admin', '/admin/default/index'),
 38 (BASE + '/admin/$anything', '/admin/$anything'),
 39 # do not reroute appadmin unless you want to disable it
 40 (BASE + '/$app/appadmin', '/$app/appadmin/index'),
 41 (BASE + '/$app/appadmin/$anything', '/$app/appadmin/$anything'),
 42 # do not reroute static files
 43 (BASE + '/$app/static/$anything', '/$app/static/$anything'),
 44 # reroute favicon and robots, use exable for lack of better choice
 45 ('/favicon.ico', '/examples/static/favicon.ico'),
 46 ('/robots.txt', '/examples/static/robots.txt'),
 47 

 48 ## This raises the invalid request message
 49 

 50 ('.*./apps',  '/init/default/user/login'),
 51 # remove the BASE prefix
 52 (BASE + '/$anything', '/$anything'),
 53 )
 54 
 55 # routes_out, like routes_in translates URL paths created with the 
web2py URL()
 56 # function in the same manner that route_in translates inbound URL 
paths.
 57 #
 58 
 59 routes_out = (
 60 # do not reroute admin unless you want to disable it
 61 ('/admin/$anything', BASE + '/admin/$anything'),
 62 # do not reroute appadmin unless you want to disable it
 63 ('/$app/appadmin/$anything', BASE + '/$app/appadmin/$anything'),
 64 # do not reroute static files
 65 ('/$app/static/$anything', BASE + '/$app/static/$anything'),
 66 # do other stuff
 67 ('/init/default/user/login',  '.*./apps'),
 68 # (r'.*http://otherdomain\.com.* /app/ctr(?P.*)', r'\g'),
 69 # (r'/app(?P.*)', r'\g'),
 70 

 71 ## Or maybe it is here
 72 

 73 ('/init/default/user/login', '.*./apps'),
 74 # restore the BASE prefix
 75 ('/$anything', BASE + '/$anything'),
 76 )



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] SQLFORM.grid Export and represent

2014-04-16 Thread John Fraser
Is there an easy way to strip HTML markup from SQLFORM.grid's CSV/TSV 
export?  I realize I probably need to create a custom export function, but 
curious if there is an argument or a one liner that would do the trick.  Or 
is there a better way to format the display?

I have the following controller function:

@auth.requires_login()
def index():
response.title = 'Computer Inventory'
db.inventory.id.readable = False
db.inventory.cpu_status.represent = lambda cpu_status, row: \
SPAN(row.cpu_status,
 _style='text-transform: uppercase; font-weight: bold; 
padding:5px; color: %s; background-color: %s' %
 ('black' if row.cpu_status == 'Staged' else 'white','red' if 
row.cpu_status == 'Repair' else 'gold'
 if row.cpu_status == 'Staged' else 'green' if row.cpu_status 
== 'In Use' else 'black'))
grid = SQLFORM.grid(db.inventory, csv=True)
return locals()


When I export as CSV/TSV (as displayed to the user) all values for 
db.inventory.cpu_status are wrapped in SPAN tags for example:

VALUE


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] 'Table' object has no attribute 'attr'

2014-04-16 Thread Richard
I have used a form in a view and want to update a record after submit:
 
View:
{{=SQLFORM(db.activity, record = a.id, deletable = True,  
hidden=dict(attr='chgact'))}}
 
 
controller:
 
if (request.vars['attr'] == 'chgact') and 
(request.vars['delete_this_record'] != 'on'):
db(db.activity._id == 
request.vars['id']).update(**dict(request.vars)) 
 
I use the convention in the controller because is is described in the 
manual in chapter 6:

The update of record with given id can be done with: 
Inserting and updating from a dictionary

A common issue consists of needing to insert or update records in a table 
where the name of the table, the field to be updated, and the value for the 
field are all stored in variables. For example: tablename, fieldname, and 
value.

The insert can be done using the following syntax:

db[tablename].insert(**{fieldname:value})

The update of record with given id can be done with: 
db(db[tablename]._id==id).update(**{fieldname:value})

Notice we used table._id instead of table.id. In this way the query works 
even for tables with a field of type "id" which has a name other than "id".


What is going 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/d/optout.


Re: [web2py] Re: Change the download text from "file" to something else?

2014-04-16 Thread António Ramos
a litle more info i use sqlform

form=SQLFORM(db.trabalhador,row.id,
showid=False,
submit_button="Gravar",
fields=formfields,
table_name='trabalhador',
formstyle = 'table2cols',
upload=URL('download'),
readonly=readonly
)

 to create the form and in my view i have only {{=form}}


2014-04-16 15:18 GMT+01:00 António Ramos :

> i created this in my view before the upload widget
> {{=T("file ## download")}}
>
> i see it in my language file and i translate it.
>
> i refresh this page and the h1 tag shows the translated text but the
> upload widget continues to show "file" next to the upload button.
>
> So it does not solve my problem.
>
>
> 2014-04-16 12:52 GMT+01:00 Niphlod :
>
> there should be one. if not, i should be created
>>
>> On Tuesday, April 15, 2014 4:23:24 PM UTC+2, Ramos wrote:
>>>
>>>
>>> 2014-04-15 14:24 GMT+01:00 Niphlod :
>>>
 'file ## download'

>>>
>>> You lost me
>>> where do i find the string "'file ## download'
>>> ?
>>>
>>  --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Change the download text from "file" to something else?

2014-04-16 Thread António Ramos
i created this in my view before the upload widget
{{=T("file ## download")}}

i see it in my language file and i translate it.

i refresh this page and the h1 tag shows the translated text but the upload
widget continues to show "file" next to the upload button.

So it does not solve my problem.


2014-04-16 12:52 GMT+01:00 Niphlod :

> there should be one. if not, i should be created
>
> On Tuesday, April 15, 2014 4:23:24 PM UTC+2, Ramos wrote:
>>
>>
>> 2014-04-15 14:24 GMT+01:00 Niphlod :
>>
>>> 'file ## download'
>>>
>>
>> You lost me
>> where do i find the string "'file ## download'
>> ?
>>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] T when sending email

2014-04-16 Thread Kenneth
Hello,

I'm trying to send email that is made from about 6-7 T('texts'). But 
newlines are not inserted into the emails. 

How should I do that?


Kenneth

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Change the download text from "file" to something else?

2014-04-16 Thread Niphlod
there should be one. if not, i should be created

On Tuesday, April 15, 2014 4:23:24 PM UTC+2, Ramos wrote:
>
>
> 2014-04-15 14:24 GMT+01:00 Niphlod >:
>
>> 'file ## download'
>>
>
> You lost me
> where do i find the string "'file ## download'
> ?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] too many values to unpack

2014-04-16 Thread Carlos Costa
To show some code should help us to help you.

This type of error occurs when something like this is tried;
d = dict(a='a',b='b')
a, b, c = d



2014-04-16 6:36 GMT-03:00 Richard :

>
> I have a working app and added a list of form in the response variables
> from the controller tot the view. Now the app comes with the error "too
> many values to unpack".
> I can imagine that there is a limit tot the response size. Is there and
> how can I increase this.
>
> Background info: I want to add a button to records for changing and
> deleting that record. So I create a list of forms with the specific
> record=id parameter. This solution is not optimal for memory and speed, but
> quite easy to implement. Some clever rpc functionality might also do the
> trick.
>
> Thanks.
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Att.

Carlos J. Costa
Cientista da Computação
Esp. Gestão em Telecom

EL MELECH NEEMAN!
אָמֵן

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Nginx/passenger/web2py -> 504 Gateway Timeout?

2014-04-16 Thread LightDot
I use apache and mod_passenger (Scientific Linux 6.x / EPEL) on a couple of 
high traffic web2py apps, works like a charm. Passenger is really neat, I'm 
testing an unified solution that provides python, nodejs and ruby support 
with seamless passtrough for PHP / HTML / static files.

Apart of configuring apache / passenger, the only thing needed on web2py 
side was to use wsgihandler.py, renamed as passenger_wsgi.py.

So, I would say this is a configuration issue... But I'm not sure what's 
theproblem. @Krzysztof, 
when you say you've put all web2py files within the folder, expected by 
passenger, did you omit the top web2py directory? The structure should be 
simply:

top_passenger_dir/
  applications
  deposit
  gluon
  ...etc...
  passenger_wsgi.py
  web2py.py

Regards

On Tuesday, April 15, 2014 6:17:17 PM UTC+2, Richard wrote:
>
> I make it works with Phusion long time ago, and then get convinced after 
> reading a blog post that this were a bad idea, since at that time phusion 
> was not following the same rule as other linux in matter of service 
> managment, so I resign. I remember having read and work hard, since there 
> were no single one-stop place to make it works... The phusion doc, was the 
> better place + blog post and tuto.
>
> Sorry I couldn't help more... But I would again suggest you to walkaway of 
> phusion if you can somehow. My understanding is this project is not enough 
> or wasn't (1,5 years ago) to work in production. I was required to compile 
> Nginx to include phusion module because it is not include by default, to me 
> just that is enough to not consider it prod ready...
>
> Richard
>
>
> On Tue, Apr 15, 2014 at 3:34 AM, Krzysztof Socha 
> 
> > wrote:
>
>> Thanks... But I kinda cannot... The hosting I am using is providing nginx 
>> + phusion passenger... and it works with a simple script, as I have shown. 
>> Unfortunately, it looks like the web2py handler never returns anything and 
>> the request time-outs... I do not even know where to look to understand 
>> what happens... Any suggestions?
>>
>> Krzysztof.
>>
>>
>> On Monday, April 14, 2014 3:58:16 PM UTC+2, Richard wrote:
>>>
>>> Use unicorn!!
>>>
>>> Phusion is more work...
>>>
>>> You can have a look in contrib there is a scrip that help deploy redmine 
>>> beside web2py with unicorn, so you can derive something for you need from 
>>> it. It works with 12.04.
>>>
>>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Online Manual: Chapter 9: Access Control - Formatting/content issues?

2014-04-16 Thread Michele Comitini
+1
Thank you Tim!

2014-04-16 8:48 GMT+02:00 Seeker :
> Thanks lots Tim.
>
>
> On Tuesday, 15 April 2014 14:24:25 UTC+2, Tim Richardson wrote:
>>
>>
>>
>> On Monday, 14 April 2014 22:05:44 UTC+10, Seeker wrote:
>>>
>>> Hi Tim,
>>>
>>> Any idea how long it will take for caches to clear?  The problem still
>>> persists :-|
>>>
>>>
>> It's ok now.
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] too many values to unpack

2014-04-16 Thread Richard

I have a working app and added a list of form in the response variables 
from the controller tot the view. Now the app comes with the error "too 
many values to unpack".
I can imagine that there is a limit tot the response size. Is there and how 
can I increase this.

Background info: I want to add a button to records for changing and 
deleting that record. So I create a list of forms with the specific 
record=id parameter. This solution is not optimal for memory and speed, but 
quite easy to implement. Some clever rpc functionality might also do the 
trick.

Thanks.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.