Re: [web2py] list:string

2014-04-03 Thread Manuele Pesenti
Il 03/04/14 06:23, horridohobbyist ha scritto:
 I've added a 'list:string' field to my table, but when adding a new
 record from admin (using the new record form), I can't figure out how
 to enter the data. I don't understand what format it expects.

 I tried ['item1','item2']. I tried |'item1'|'item2'|. They both
 don't work.
Try adding an SQLFORM in a controller, add some data as a user and go as
admin to the admin interface and edit data you entered.
list:string has a default widget inside SQLFORM that let you enter each
item.

Hope to be of any help

Cheers

M.

-- 
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] Simple question for registrations to filter bots

2014-04-03 Thread Thomas Wimmer
Hello!

How can i add a simple question to the registration form?

It shall prevent bots from the registration.

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


Re: [web2py] Simple question for registrations to filter bots

2014-04-03 Thread Kiran Subbaraman

  
  
Thomas,
  A captcha would help?
  http://www.web2py.com/book/default/chapter/09#CAPTCHA-and-reCAPTCHA
  
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
  On Thu, 03-04-2014 3:16 PM, Thomas Wimmer wrote:


  Hello!


How can i add a simple question to the registration form?


It shall prevent bots from the registration.


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/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: manage extra custom field with ldap_auth

2014-04-03 Thread maurizio
Is there an alternative instead modify ldap_auth.py module?

any help will be appreciated
maurizio


Il giorno mercoledì 26 marzo 2014 10:21:17 UTC+1, maurizio ha scritto:

 ldap_auth() got an unexpected keyword argument 'user_employeeid_attrib'
 Il giorno lunedì 24 marzo 2014 12:24:03 UTC+1, maurizio ha scritto:

 Hi all,
 i try to manage extra custom field from ldap via ldap_auth user attribute:
 but I can't figure out how to manage it...
 any idea?

 code snippet:

 auth.settings.extra_fields['auth_user']= [
 Field('employeeid' , type='string')]
 ...
 ...

 auth.settings.login_methods = [ldap_auth(mode = 'ad',
 server = 'DCserver',
 base_dn = 'DC=domain,DC=it',
 db = db,
 manage_user = True,
 user_firstname_attrib = 'givenName',
 user_lastname_attrib = 'sn',
 user_mail_attrib = 'mail'
 user_employeeid_attrib = 'employeeID'
 )]

 thanks in advance
 maurizio



-- 
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] Simple question for registrations to filter bots

2014-04-03 Thread Thomas Wimmer
Yes, that would help, but is not what i want.

Am Donnerstag, 3. April 2014 12:17:41 UTC+2 schrieb Kiran Subbaraman:

  Thomas,
 A captcha would help? 
 http://www.web2py.com/book/default/chapter/09#CAPTCHA-and-reCAPTCHA

 
 Kiran Subbaramanhttp://subbaraman.wordpress.com/about/

 On Thu, 03-04-2014 3:16 PM, Thomas Wimmer wrote:
  
 Hello! 

  How can i add a simple question to the registration form?

  It shall prevent bots from the registration.

  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+un...@googlegroups.com javascript:.
 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] add private folder to files_menu again

2014-04-03 Thread sunny
hi,

could you please add the private folder to the files_menu in the admin 
app again?

web2py/applications/admin/controller/default.py:

def files_menu():

app = request.vars.app or 'welcome'

dirs=[{'name':'models', 'reg':'.*\.py$'},

  {'name':'controllers', 'reg':'.*\.py$'},

  {'name':'views', 'reg':'[\w/\-]+(\.\w+)+$'},

  {'name':'modules', 'reg':'.*\.py$'},

  {'name':'static', 'reg': '[^\.#].*'},

+  {'name':'private', 'reg':'.*\.py$'},

]

web2py/applications/admin/views/default/edit.html:

dirs=[{'name':'models', 'reg':'.*\.py$'},

  {'name':'controllers', 'reg':'.*\.py$'},

  {'name':'views', 'reg':'[\w/\-]+(\.\w+)+$'},

  {'name':'modules', 'reg':'.*\.py$'},

  {'name':'static', 'reg': '[^\.#].*'},

+  {'name':'private', 'reg':'.*\.py$'}

]

thanks,
sven

-- 
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] Simple question for registrations to filter bots

2014-04-03 Thread Kiran Subbaraman

  
  
You mean something like a "what is the
  sum of 2 + 5?" kind of question? And whether there is something in
  web2py that provides a challenge of that sort? Based on my
  reading, haven't come across stuff like this in web2py
  out-of-the-box; maybe something that needs to be created from
  scratch. Also, is an useful alternative to captcha.
  
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
  On Thu, 03-04-2014 4:12 PM, Thomas Wimmer wrote:


  Yes, that would help, but is not what i want.

Am Donnerstag, 3. April 2014 12:17:41 UTC+2 schrieb Kiran
Subbaraman:

  
Thomas,
  A captcha would help? http://www.web2py.com/book/default/chapter/09#CAPTCHA-and-reCAPTCHA
  
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
  On Thu, 03-04-2014 3:16 PM, Thomas Wimmer wrote:


  Hello!


How can i add a simple question to the registration
  form?


It shall prevent bots from the registration.


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


  




-- 
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] list:string

2014-04-03 Thread horridohobbyist
Well, I added data by using db.update() instead of SQLFORM. The data is 
definitely in there, and it works. However, in admin, *the data is not 
visible* in the list:string field (it's empty), so I can't edit it. The 
behaviour of the list:string data type is very strange. Why is it like 
that? Or am I doing something wrong?


On Thursday, 3 April 2014 02:49:45 UTC-4, Manuele wrote:

 Il 03/04/14 06:23, horridohobbyist ha scritto: 
  I've added a 'list:string' field to my table, but when adding a new 
  record from admin (using the new record form), I can't figure out how 
  to enter the data. I don't understand what format it expects. 
  
  I tried ['item1','item2']. I tried |'item1'|'item2'|. They both 
  don't work. 
 Try adding an SQLFORM in a controller, add some data as a user and go as 
 admin to the admin interface and edit data you entered. 
 list:string has a default widget inside SQLFORM that let you enter each 
 item. 

 Hope to be of any help 

 Cheers 

 M. 


-- 
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: Major issue with request separation

2014-04-03 Thread Willoughby
Sessions?

On Wednesday, April 2, 2014 12:27:52 PM UTC-4, cl...@northernbrewer.com 
wrote:

 I'm having a major issue with a web2py application in a production 
 environment. It is easily reproducible and causing major issues.

 At it's most basic level I can make a new function which does just one 
 thing - dumps something out to a log, appends to a file, posts an xmlrpc 
 response, etc. all results are the same.

 The result is If multiple clients request the same controller action at 
 the same time, only one of the requests is processed, and all clients 
 receive the same response.

 For example, 2 clients call myfunction. Both get a response, but 
 myfunction writes to a log, file, or makes an external request only once! 
 This is a major issue, because many functions make an xmlrpc call to 
 another server, and everyone gets the same data, not what they requested.

 For what it is worth, these requests are coming in from Javascript/Ajax - 
 although that should not matter, multiple clients should be able to request 
 the same URL and get the correct data for what they posted. If these 
 requests are separated by 1 second, then they work normally, but any less 
 and this problem appears.

 Is there something missing here? A decorator or request._ variable 
 that needs to be set? 

 Any insight is greatly appreciated.


-- 
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: Major issue with request separation

2014-04-03 Thread LightDot
Clients need to be uniquely identified, then you can track and return 
content to them accordingly. So, you need some form of authentication / 
identification / authorization. Web2py has access control built in and this 
might provide all you need to get you started.

Regards

On Wednesday, April 2, 2014 6:27:52 PM UTC+2, cl...@northernbrewer.com 
wrote:

 I'm having a major issue with a web2py application in a production 
 environment. It is easily reproducible and causing major issues.

 At it's most basic level I can make a new function which does just one 
 thing - dumps something out to a log, appends to a file, posts an xmlrpc 
 response, etc. all results are the same.

 The result is If multiple clients request the same controller action at 
 the same time, only one of the requests is processed, and all clients 
 receive the same response.

 For example, 2 clients call myfunction. Both get a response, but 
 myfunction writes to a log, file, or makes an external request only once! 
 This is a major issue, because many functions make an xmlrpc call to 
 another server, and everyone gets the same data, not what they requested.

 For what it is worth, these requests are coming in from Javascript/Ajax - 
 although that should not matter, multiple clients should be able to request 
 the same URL and get the correct data for what they posted. If these 
 requests are separated by 1 second, then they work normally, but any less 
 and this problem appears.

 Is there something missing here? A decorator or request._ variable 
 that needs to be set? 

 Any insight is greatly appreciated.


-- 
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: add private folder to files_menu again

2014-04-03 Thread Massimo Di Pierro
Please open a ticket about this and we will discuss it on web2py developers.

On Thursday, 3 April 2014 06:08:41 UTC-5, sunny wrote:

 hi,

 could you please add the private folder to the files_menu in the admin 
 app again?

 web2py/applications/admin/controller/default.py:

 def files_menu():

 app = request.vars.app or 'welcome'

 dirs=[{'name':'models', 'reg':'.*\.py$'},

   {'name':'controllers', 'reg':'.*\.py$'},

   {'name':'views', 'reg':'[\w/\-]+(\.\w+)+$'},

   {'name':'modules', 'reg':'.*\.py$'},

   {'name':'static', 'reg': '[^\.#].*'},

 +  {'name':'private', 'reg':'.*\.py$'},

 ]

 web2py/applications/admin/views/default/edit.html:

 dirs=[{'name':'models', 'reg':'.*\.py$'},

   {'name':'controllers', 'reg':'.*\.py$'},

   {'name':'views', 'reg':'[\w/\-]+(\.\w+)+$'},

   {'name':'modules', 'reg':'.*\.py$'},

   {'name':'static', 'reg': '[^\.#].*'},

 +  {'name':'private', 'reg':'.*\.py$'}

 ]

 thanks,
 sven


-- 
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: Major issue with request separation

2014-04-03 Thread Anthony
I think we need to see some code.

On Wednesday, April 2, 2014 12:27:52 PM UTC-4, cl...@northernbrewer.com 
wrote:

 I'm having a major issue with a web2py application in a production 
 environment. It is easily reproducible and causing major issues.

 At it's most basic level I can make a new function which does just one 
 thing - dumps something out to a log, appends to a file, posts an xmlrpc 
 response, etc. all results are the same.

 The result is If multiple clients request the same controller action at 
 the same time, only one of the requests is processed, and all clients 
 receive the same response.

 For example, 2 clients call myfunction. Both get a response, but 
 myfunction writes to a log, file, or makes an external request only once! 
 This is a major issue, because many functions make an xmlrpc call to 
 another server, and everyone gets the same data, not what they requested.

 For what it is worth, these requests are coming in from Javascript/Ajax - 
 although that should not matter, multiple clients should be able to request 
 the same URL and get the correct data for what they posted. If these 
 requests are separated by 1 second, then they work normally, but any less 
 and this problem appears.

 Is there something missing here? A decorator or request._ variable 
 that needs to be set? 

 Any insight is greatly appreciated.


-- 
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: list:string

2014-04-03 Thread Anthony
Can we see some code (and maybe a screenshot of what you see)? The default 
list:string widget requires an up-to-date web2py.js file.

On Thursday, April 3, 2014 12:23:08 AM UTC-4, horridohobbyist wrote:

 I've added a 'list:string' field to my table, but when adding a new record 
 from admin (using the new record form), I can't figure out how to enter the 
 data. I don't understand what format it expects.

 I tried ['item1','item2']. I tried |'item1'|'item2'|. They both don't 
 work.


-- 
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: Paypal Recurring Payments? Any experience? Any alternatives?

2014-04-03 Thread Greg Vaughan
Not Austria at the moment no... They are however in Beta in...

   - Belgium 
   -  Finland 
   -  France 
   -  Germany 
   -  Luxembourg 
   -  Netherlands 
   -  Spain 

which is easy to get an invite to... as far as the rest of Europe goes 
though the fractionated banking economy makes it a far more difficult 
proposition to get to the smaller economies.

On Wednesday, 2 April 2014 15:28:35 UTC+10, mweissen wrote:

 Stripe looks good, but could not be used in Austria/Europe. Sorry!  :-(
 Martin


 2014-04-02 5:38 GMT+02:00 Greg Vaughan greg.s@gmail.com javascript:
 :

 Stripe charges me (in Australia) 2.7% + 30cents for each transaction 
 processed, Visa, Mastercard or American Express. No other fees that are 
 typically charged by other alternatives (Authorize.net) monthly fee, annual 
 fee, chargeback fee etc... it is very much the simplest and most direct... 
 payments are batch transferred to you account on a 7 day rolling cycle. 
 Again this is as good as any other alternative. If you have a fixed amount 
 to charge it can be implemented within 5 minutes using their js code for 
 checkout. 

 For a manual form you can use their custom implementation or Massimo's 
 code above with his library...

 If you want a custom payment system you will have to write the code to 
 pass that to the stripe server when you are charging for the service...

 Oh also... verifying your business takes about 2 minutes... and you 
 definitely wont beat that.

 Stripe has nothing to do with PayPal you host it on your site... (must be 
 https... get a certificate from start.com for free) so there is NO 
 PayPal tax...


 On Wednesday, 2 April 2014 09:41:32 UTC+10, Matheus Cardoso wrote:

 So, if someone uses Stripe, he will pay only the fee from Stripe and 
 this will cover the PayPal's tax? 

 On Monday, March 31, 2014 6:57:14 AM UTC-3, Mika Sjöman wrote:

 Hi

 I wonder if anyone here has implemented recurring payments with Paypal 
 here with Web2py? Any experience with this and how to implement it?

 We currently charge people for lessons with our teachers, but we would 
 like to go over to a payment model where we automatically charge the 
 customers every month. 

 Is there a better way of doing this than Paypal? Market is mostly US 
 and China based. 

 Cheers

  -- 
 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 javascript:.
 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: list:string

2014-04-03 Thread horridohobbyist
db.define_table('products',
Field('thumbnail', 
'upload',uploadfield='image_data',represent=lambda v, r: 
IMG(_src=URL('download',args=v))),
Field('image_data', 'blob',readable=False),
Field('name',unique=True,represent=lambda v, r: 
A(v,_href=URL('view',args=[db.products,r.id])) + XML('br'+r.description)),
Field('category',represent=lambda v, r: 
DIV(v,_style='width:75px;word-wrap:break-word;')),
Field('description','text',represent=lambda v, r: ''),
Field('choices','text',readable=False),
Field('shift','list:string',readable=False),

I initialize the field with .update(shift=['colour','size'])

When I retrieve the field, I indeed can access the list items. However, in 
admin, I see this:

https://lh4.googleusercontent.com/-EfRWKJ_pUWQ/Uz1spRS9D0I/A40/H6TpxX6w7oM/s1600/Screen+Shot+2014-04-03+at+10.08.10+AM.png
I know the data is in the field. Why can't I see it??


On Thursday, 3 April 2014 09:37:41 UTC-4, Anthony wrote:

 Can we see some code (and maybe a screenshot of what you see)? The default 
 list:string widget requires an up-to-date web2py.js file.

 On Thursday, April 3, 2014 12:23:08 AM UTC-4, horridohobbyist wrote:

 I've added a 'list:string' field to my table, but when adding a new 
 record from admin (using the new record form), I can't figure out how to 
 enter the data. I don't understand what format it expects.

 I tried ['item1','item2']. I tried |'item1'|'item2'|. They both 
 don't work.



-- 
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: after_update callback question

2014-04-03 Thread mcamel


 Be careful about storing something in request.vars, as some other code may 
 depend on request.vars and end up failing due to it being changed.


 Any alternative you can suggest?. Session object seems error prone for 
 this because of concurrency...


 You could just declare a global variable:


That works fine to pass values from 'before' callback to 'after' callback, 
but fails if you want to pass values from 'after' callback (in a module) to 
the function that triggered it (in a controller).
 
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.


[web2py] Re: list:string

2014-04-03 Thread Anthony
And you're sure you have the version of web2py.js associated with the 
version of web2py you are running, and that it is loaded on the page?

On Thursday, April 3, 2014 10:17:58 AM UTC-4, horridohobbyist wrote:

 db.define_table('products',
 Field('thumbnail', 
 'upload',uploadfield='image_data',represent=lambda v, r: 
 IMG(_src=URL('download',args=v))),
 Field('image_data', 'blob',readable=False),
 Field('name',unique=True,represent=lambda v, r: 
 A(v,_href=URL('view',args=[db.products,r.id])) + 
 XML('br'+r.description)),
 Field('category',represent=lambda v, r: 
 DIV(v,_style='width:75px;word-wrap:break-word;')),
 Field('description','text',represent=lambda v, r: ''),
 Field('choices','text',readable=False),
 Field('shift','list:string',readable=False),

 I initialize the field with .update(shift=['colour','size'])

 When I retrieve the field, I indeed can access the list items. However, in 
 admin, I see this:


 https://lh4.googleusercontent.com/-EfRWKJ_pUWQ/Uz1spRS9D0I/A40/H6TpxX6w7oM/s1600/Screen+Shot+2014-04-03+at+10.08.10+AM.png
 I know the data is in the field. Why can't I see it??


 On Thursday, 3 April 2014 09:37:41 UTC-4, Anthony wrote:

 Can we see some code (and maybe a screenshot of what you see)? The 
 default list:string widget requires an up-to-date web2py.js file.

 On Thursday, April 3, 2014 12:23:08 AM UTC-4, horridohobbyist wrote:

 I've added a 'list:string' field to my table, but when adding a new 
 record from admin (using the new record form), I can't figure out how to 
 enter the data. I don't understand what format it expects.

 I tried ['item1','item2']. I tried |'item1'|'item2'|. They both 
 don't work.



-- 
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: after_update callback question

2014-04-03 Thread Anthony
On Thursday, April 3, 2014 10:58:32 AM UTC-4, mcamel wrote:


 Be careful about storing something in request.vars, as some other code may 
 depend on request.vars and end up failing due to it being changed.


 Any alternative you can suggest?. Session object seems error prone for 
 this because of concurrency...


 You could just declare a global variable:


 That works fine to pass values from 'before' callback to 'after' callback, 
 but fails if you want to pass values from 'after' callback (in a module) to 
 the function that triggered it (in a controller).


That's a different story. In that case, you could add something to 
current.

Anthony 

-- 
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] URL of an external website

2014-04-03 Thread Louis Amon
This is indeed a smart way to do it, thanks for the answer !


On a sidenote, I actually used URL() to do the following to retrieve more 
geocoding information:

 google_geo_url = URL(scheme='http', host='maps.googleapis.com', a='maps', 
 c='api', f='geocode', args=['json'], vars={'sensor':'false', 
 'address':addr})


Which, I find, is a very elegant way to make a call to an external API.

As Massimo mentioned : this only works if a/c/f are ALL defined, which can 
be confusing. But then again : URL wasn't designed for external urls.

I think Jonathan's idea to make a XURL() helper would be a nice improvement 
: it is equivalent to using encodeURL but definitely more web2py-esque.
URL(..., external=True) could also do the trick.

Like villas, I believed that specifying an explicit scheme and host would 
necessarily make it an external URL...

On Thursday, March 27, 2014 5:25:15 PM UTC+1, Jonathan Lundell wrote:

 On 27 Mar 2014, at 6:49 AM, Louis Amon moo...@msn.com javascript: 
 wrote: 
  I'm trying to use the URL() function to connect to an external website's 
 API, thus benefitting from web2py's HTML entity encoding feature. 
  
  I wrote something like this : 
  
  URL(scheme='http', domain='www.example.org', a='API', 
 vars={'locality':'some, city'}) 
  
  and found that the encoded URL turns out like this : 
  http://www.example.org/APP_NAME/API?locality=some%2C+city 
  
  With APP_NAME being my current application in web2py... 
  
  
  I found a monkeypatch solution like this : 
  URL(scheme='http', domain='www.example.org', a='API', c=' ', f=' ', 
 vars={'locality':'some, city'}) 

  Which gives me an ugly but functional URL : 
  http://www.example.org/API/ / ?locality=some%2C+city 
  
  
  
  Is there a more elegant solution to this ? 
  
  

 URL() doesn't anticipate being used to generate external URLs, only web2py 
 URLs. You'd be better off, I think, writing your own utility routine to do 
 what you're after. urllib.urlencode does the magic for your query string 
 (vars). 

 So for your example, something like: 

 encodeURL(http://www.example.org;, path=['API'], 
 query={'locality':'some, city'}) 

 ...would be pretty trivial to write (path is a list of URL path elements 
 to be suitable encoded and joined with '/').

-- 
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: Book layout appears broken

2014-04-03 Thread Louis Amon
It doesn't look like it's fixed (or at least not online)

http://web2py.com/books/default/chapter/29/09/access-control#Renaming-Auth-tables


I'll stick to the printed version for now

On Wednesday, March 12, 2014 4:34:30 AM UTC+1, Tim Richardson wrote:

 And fixed now. Sorry, that was my bad.

 On Wednesday, 12 March 2014 11:43:50 UTC+11, Tim Richardson wrote:

 Yes,
 there is a PR to fix it.


 On Wednesday, 12 March 2014 00:12:32 UTC+11, Remco Boerma wrote:


 http://web2py.com/books/default/chapter/29/09/access-control#Renaming-Auth-tables
  

 There's a screwup of the layout starting somewhere in that section. 


 -- 
 Cheers / Met vr. gr. 
 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/d/optout.


[web2py] Admin not actually disabled after 5 login attempts?

2014-04-03 Thread Joe Buck
Hello web2py-users,

I'm using web2py 2.7.4-stable+timestamp.2013.10.14.15.16.29 installed via 
the TurnkeyLinux distro(mod_wsgi).
When I try to authenticate in the admin app over https using a wrong 
password more than 5 times, I am able to log in on the 6th attempt using 
the correct password without the 1 hour wait.  
After the 5th attempt, my ip address is visible in hosts.deny log.  It is 
removed after the 6th attempt with correct password entered.
All of the session flashes are accurate.
I'm new to web2pp and probably have overlooked a setting or I do not 
understand the intended behavior.
Is there a way to make sure admin is actually disabled after failed 
authentication attempts?

Thank you,

Joe Buck


-- 
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: list:string

2014-04-03 Thread horridohobbyist
I upgraded to web2py 2.9.4 recently. Unless the upgrade was corrupted, I 
should be using the correct files. How can I tell if the web2py.js I have 
is correct or not? There's no identifying information.


On Thursday, 3 April 2014 11:09:07 UTC-4, Anthony wrote:

 And you're sure you have the version of web2py.js associated with the 
 version of web2py you are running, and that it is loaded on the page?

 On Thursday, April 3, 2014 10:17:58 AM UTC-4, horridohobbyist wrote:

 db.define_table('products',
 Field('thumbnail', 
 'upload',uploadfield='image_data',represent=lambda v, r: 
 IMG(_src=URL('download',args=v))),
 Field('image_data', 'blob',readable=False),
 Field('name',unique=True,represent=lambda v, r: 
 A(v,_href=URL('view',args=[db.products,r.id])) + 
 XML('br'+r.description)),
 Field('category',represent=lambda v, r: 
 DIV(v,_style='width:75px;word-wrap:break-word;')),
 Field('description','text',represent=lambda v, r: ''),
 Field('choices','text',readable=False),
 Field('shift','list:string',readable=False),

 I initialize the field with .update(shift=['colour','size'])

 When I retrieve the field, I indeed can access the list items. However, 
 in admin, I see this:


 https://lh4.googleusercontent.com/-EfRWKJ_pUWQ/Uz1spRS9D0I/A40/H6TpxX6w7oM/s1600/Screen+Shot+2014-04-03+at+10.08.10+AM.png
 I know the data is in the field. Why can't I see it??


 On Thursday, 3 April 2014 09:37:41 UTC-4, Anthony wrote:

 Can we see some code (and maybe a screenshot of what you see)? The 
 default list:string widget requires an up-to-date web2py.js file.

 On Thursday, April 3, 2014 12:23:08 AM UTC-4, horridohobbyist wrote:

 I've added a 'list:string' field to my table, but when adding a new 
 record from admin (using the new record form), I can't figure out how to 
 enter the data. I don't understand what format it expects.

 I tried ['item1','item2']. I tried |'item1'|'item2'|. They both 
 don't work.



-- 
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: after_update callback question

2014-04-03 Thread mcamel
Sorry, i wanted to say 'model' not 'module'.

I've tried to pass data from a callback in a model to its function in a 
controller with 'current', but was not able:

def my_before_callback():
from gluon import current
current._mydata = 'hello'

In a controller:

def my_function():
db.update()
from gluon import current
response.flash = current._mydata

but got error:

type 'exceptions.AttributeError' 'thread._local' object has no attribute 
'_mydata'


I'm doing something wrong or it's just that it applies only for modules and 
not for models and/or controllers?.

I'm sure the callback is called because all works if i replace 'current' 
with 'request.vars'.


Thanks for your time.


El jueves, 3 de abril de 2014 17:10:57 UTC+2, Anthony escribió:

 On Thursday, April 3, 2014 10:58:32 AM UTC-4, mcamel wrote:


 Be careful about storing something in request.vars, as some other code 
 may depend on request.vars and end up failing due to it being changed.


 Any alternative you can suggest?. Session object seems error prone for 
 this because of concurrency...


 You could just declare a global variable:


 That works fine to pass values from 'before' callback to 'after' 
 callback, but fails if you want to pass values from 'after' callback (in a 
 module) to the function that triggered it (in a controller).


 That's a different story. In that case, you could add something to 
 current.

 Anthony 


-- 
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: list:string

2014-04-03 Thread Anthony
Unless you explicitly copied the new web2py.js file from /welcome/static/js 
to the /static/js folder of your existing app, then you don't have the 
updated version of web2py.js.

Anthony

On Thursday, April 3, 2014 11:47:15 AM UTC-4, horridohobbyist wrote:

 I upgraded to web2py 2.9.4 recently. Unless the upgrade was corrupted, I 
 should be using the correct files. How can I tell if the web2py.js I have 
 is correct or not? There's no identifying information.


 On Thursday, 3 April 2014 11:09:07 UTC-4, Anthony wrote:

 And you're sure you have the version of web2py.js associated with the 
 version of web2py you are running, and that it is loaded on the page?

 On Thursday, April 3, 2014 10:17:58 AM UTC-4, horridohobbyist wrote:

 db.define_table('products',
 Field('thumbnail', 
 'upload',uploadfield='image_data',represent=lambda v, r: 
 IMG(_src=URL('download',args=v))),
 Field('image_data', 'blob',readable=False),
 Field('name',unique=True,represent=lambda v, r: 
 A(v,_href=URL('view',args=[db.products,r.id])) + 
 XML('br'+r.description)),
 Field('category',represent=lambda v, r: 
 DIV(v,_style='width:75px;word-wrap:break-word;')),
 Field('description','text',represent=lambda v, r: ''),
 Field('choices','text',readable=False),
 Field('shift','list:string',readable=False),

 I initialize the field with .update(shift=['colour','size'])

 When I retrieve the field, I indeed can access the list items. However, 
 in admin, I see this:


 https://lh4.googleusercontent.com/-EfRWKJ_pUWQ/Uz1spRS9D0I/A40/H6TpxX6w7oM/s1600/Screen+Shot+2014-04-03+at+10.08.10+AM.png
 I know the data is in the field. Why can't I see it??


 On Thursday, 3 April 2014 09:37:41 UTC-4, Anthony wrote:

 Can we see some code (and maybe a screenshot of what you see)? The 
 default list:string widget requires an up-to-date web2py.js file.

 On Thursday, April 3, 2014 12:23:08 AM UTC-4, horridohobbyist wrote:

 I've added a 'list:string' field to my table, but when adding a new 
 record from admin (using the new record form), I can't figure out how to 
 enter the data. I don't understand what format it expects.

 I tried ['item1','item2']. I tried |'item1'|'item2'|. They both 
 don't work.



-- 
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: list:string

2014-04-03 Thread Anthony
While your at it, you may want to copy the appadmin.py controller and 
appadmin.html views from the new welcome app into your app.

Anthony

On Thursday, April 3, 2014 11:54:28 AM UTC-4, Anthony wrote:

 Unless you explicitly copied the new web2py.js file from 
 /welcome/static/js to the /static/js folder of your existing app, then you 
 don't have the updated version of web2py.js.

 Anthony

 On Thursday, April 3, 2014 11:47:15 AM UTC-4, horridohobbyist wrote:

 I upgraded to web2py 2.9.4 recently. Unless the upgrade was corrupted, I 
 should be using the correct files. How can I tell if the web2py.js I have 
 is correct or not? There's no identifying information.


 On Thursday, 3 April 2014 11:09:07 UTC-4, Anthony wrote:

 And you're sure you have the version of web2py.js associated with the 
 version of web2py you are running, and that it is loaded on the page?

 On Thursday, April 3, 2014 10:17:58 AM UTC-4, horridohobbyist wrote:

 db.define_table('products',
 Field('thumbnail', 
 'upload',uploadfield='image_data',represent=lambda v, r: 
 IMG(_src=URL('download',args=v))),
 Field('image_data', 'blob',readable=False),
 Field('name',unique=True,represent=lambda v, r: 
 A(v,_href=URL('view',args=[db.products,r.id])) + 
 XML('br'+r.description)),
 Field('category',represent=lambda v, r: 
 DIV(v,_style='width:75px;word-wrap:break-word;')),
 Field('description','text',represent=lambda v, r: ''),
 Field('choices','text',readable=False),
 Field('shift','list:string',readable=False),

 I initialize the field with .update(shift=['colour','size'])

 When I retrieve the field, I indeed can access the list items. However, 
 in admin, I see this:


 https://lh4.googleusercontent.com/-EfRWKJ_pUWQ/Uz1spRS9D0I/A40/H6TpxX6w7oM/s1600/Screen+Shot+2014-04-03+at+10.08.10+AM.png
 I know the data is in the field. Why can't I see it??


 On Thursday, 3 April 2014 09:37:41 UTC-4, Anthony wrote:

 Can we see some code (and maybe a screenshot of what you see)? The 
 default list:string widget requires an up-to-date web2py.js file.

 On Thursday, April 3, 2014 12:23:08 AM UTC-4, horridohobbyist wrote:

 I've added a 'list:string' field to my table, but when adding a new 
 record from admin (using the new record form), I can't figure out how to 
 enter the data. I don't understand what format it expects.

 I tried ['item1','item2']. I tried |'item1'|'item2'|. They both 
 don't work.



-- 
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: Scheduler - clarification around heartbeat, and setting up tasks

2014-04-03 Thread Niphlod
that is probably due to the fact that you're calling queue_task inside a 
model, so you get a new queued task EVERY request that comes in.
As said by Anthony, remove the queue_task bit from your model and put 
them in a controller, else queue the task from appadmin.

On Thursday, April 3, 2014 5:17:02 PM UTC+2, Kiran Subbaraman wrote:

 Thanks for the information; and also the example around queuing the tasks 
 in such way that they are called in a specific time-bound sequence. I am 
 not trying to do that, but just focusing on adding the tasks to the 
 scheduler so that they get executed. Sequencing doesn't matter now.

 What I wanted to understand was the debug log output, which shows tasks 
 (or its worker) being executed every 0.5 to 1 second intervals. Does that 
 mean that the queue db from which they pick up the tasks is accessed every 
 second or so? And this is on the configuration where I haven't set the 
 period/repeats configuration. I guess I will try Anthony and your 
 suggestion to explore that option. Will report what I find in the debug log 
 then. 

 2014-04-01 23:36:16,642 - web2py.app.myapp - DEBUG -result: Done: 
 Task A
 2014-04-01 23:36:17,407 - web2py.app.myapp - DEBUG - new task 
 report:COMPLETED
 2014-04-01 23:36:17,408 - web2py.app.myapp - DEBUG -result: Done: 
 Task B
 2014-04-01 23:36:18,180 - web2py.app.myapp - DEBUG - new task 
 report:COMPLETED
 2014-04-01 23:36:18,180 - web2py.app.myapp - DEBUG -result: Done: 
 Task C
 2014-04-01 23:36:18,944 - web2py.app.myapp - DEBUG - new task 
 report:COMPLETED
 2014-04-01 23:36:18,944 - web2py.app.myapp - DEBUG -result: Done: 
 Task A




-- 
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: Help defining architecture for app

2014-04-03 Thread Niphlod
I think the main point you need to assess if you have enough resources to 
do what you want. If your server can't keep up with the work you're asking 
it to do, then using scheduler or whatever won't bring any benefits.
If instead you have a not-so-snappy user-interface because you don't have 
enough power to respond quickly to a user, then the scheduler is a right 
fit.

If you're seeing all the hurdle of the system on the db backend, then 
you're in the same situation as the first one, i.e. you need to buy more 
juice.

On Thursday, April 3, 2014 1:33:59 AM UTC+2, Francisco Betancourt wrote:

 Hello everyone.

 I need some help defining the architecture for an application. We already 
 have something in place, but the size of the the users data files is making 
 the site very unresponsive. The app works as follows:


1. The user uploads a csv file
2. The user file is read to a table for further processing
3. The user previews the data I read from his file (to see if 
everything is ok)
4. If data is ok he clicks a button which will make us generate an xml 
(using some of the data he uploaded) and send the xml to a web service
5. The web service is not ours, and we must send the xml files one at 
a time (though we can send hundreds simultaneously)
6. The web service returns data, and we store that data into the db
7. Once done we offer a print friendly version of the final data

 So currently we are doing the following:

1. Receive a file, and once saved we process it with web2py built in 
import from csv.
2. Once data has been read we show a view with all the rows and a 
button to start the process
3. Using js we send groups of 20 rows at a time through ajax, to be 
processed (to xml) and sent to the web service
4. Each ajax call returns js code to update a progress bar

 Originally this files were suppose to consist of hundreds hardly a 
 thousand row, but in the end we have files with 15000 rows and the average 
 is about 4000. Incredibly the view (even with 15000 rows and js) works 
 well. But the site becomes quite unresponsive (especially because there are 
 normally a dozen or so users doing the same thing simultaneously).

 We have already done as many optimizations as we know (use migrate=False 
 for db, call session.forget in ajax controller functions, byte compile the 
 code) but it still is way too slow. So we are making some heavy changes. I 
 want to try to use the scheduler and workers to do this job, but I fear it 
 will generate even more db queries and make things worse. So I would like 
 some suggestions on how to tackle this problem??

 Is scheduler the way to go? An if so should I make a task for every xml 
 and webservice call (this seems like a bad idea to me). Or should I group 
 them in chunks of an arbitrary size (e.g. 50)? And if I make this change 
 will I be able to display the progress of the process?

 Thanks for all the help. Good day.


-- 
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: list:string

2014-04-03 Thread horridohobbyist
Done. However, it didn't fix the issue, although I now see a tiny clickable 
'+' and '-' right beside the input field for 'Shift:'. I have no idea what 
that means. Clicking on them does nothing.

It's also a little disturbing that I have to manually update my apps 
whenever I upgrade web2py. *This is a disincentive for me to upgrade. My 
motto is:  If it ain't broke, don't fix it.*


On Thursday, 3 April 2014 11:55:23 UTC-4, Anthony wrote:

 While your at it, you may want to copy the appadmin.py controller and 
 appadmin.html views from the new welcome app into your app.

 Anthony

 On Thursday, April 3, 2014 11:54:28 AM UTC-4, Anthony wrote:

 Unless you explicitly copied the new web2py.js file from 
 /welcome/static/js to the /static/js folder of your existing app, then you 
 don't have the updated version of web2py.js.

 Anthony

 On Thursday, April 3, 2014 11:47:15 AM UTC-4, horridohobbyist wrote:

 I upgraded to web2py 2.9.4 recently. Unless the upgrade was corrupted, I 
 should be using the correct files. How can I tell if the web2py.js I have 
 is correct or not? There's no identifying information.


 On Thursday, 3 April 2014 11:09:07 UTC-4, Anthony wrote:

 And you're sure you have the version of web2py.js associated with the 
 version of web2py you are running, and that it is loaded on the page?

 On Thursday, April 3, 2014 10:17:58 AM UTC-4, horridohobbyist wrote:

 db.define_table('products',
 Field('thumbnail', 
 'upload',uploadfield='image_data',represent=lambda v, r: 
 IMG(_src=URL('download',args=v))),
 Field('image_data', 'blob',readable=False),
 Field('name',unique=True,represent=lambda v, r: 
 A(v,_href=URL('view',args=[db.products,r.id])) + 
 XML('br'+r.description)),
 Field('category',represent=lambda v, r: 
 DIV(v,_style='width:75px;word-wrap:break-word;')),
 Field('description','text',represent=lambda v, r: ''),
 Field('choices','text',readable=False),
 Field('shift','list:string',readable=False),

 I initialize the field with .update(shift=['colour','size'])

 When I retrieve the field, I indeed can access the list items. 
 However, in admin, I see this:


 https://lh4.googleusercontent.com/-EfRWKJ_pUWQ/Uz1spRS9D0I/A40/H6TpxX6w7oM/s1600/Screen+Shot+2014-04-03+at+10.08.10+AM.png
 I know the data is in the field. Why can't I see it??


 On Thursday, 3 April 2014 09:37:41 UTC-4, Anthony wrote:

 Can we see some code (and maybe a screenshot of what you see)? The 
 default list:string widget requires an up-to-date web2py.js file.

 On Thursday, April 3, 2014 12:23:08 AM UTC-4, horridohobbyist wrote:

 I've added a 'list:string' field to my table, but when adding a new 
 record from admin (using the new record form), I can't figure out how 
 to 
 enter the data. I don't understand what format it expects.

 I tried ['item1','item2']. I tried |'item1'|'item2'|. They both 
 don't work.



-- 
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] list:string

2014-04-03 Thread Manuele Pesenti
Il 03/04/14 14:01, horridohobbyist ha scritto:
 Well, I added data by using db.update() instead of SQLFORM. The data
 is definitely in there, and it works. However, in admin, *the data is
 not visible* in the list:string field (it's empty), so I can't edit
 it. The behaviour of the list:string data type is very strange. Why is
 it like that? Or am I doing something wrong?

heve you considered to use filter_in and filter_out trigger function...
more or less on the contrary respect on how is done in the doc?
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#filter_in-and-filter_out

M.

-- 
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] gluon.rocket.SocketTimeout'(Socket timed out before request Error

2014-04-03 Thread Ramesh Aj
The Following code is giving gluon.rocket.SocketTimeout'(Socket timed out 
before request error

{{extend 'layout.html'}}
{{import xml.etree.ElementTree as ET}}
h1
This is a Stations detail page
/h1
{{
filename = xmlfile
with open(filename, mode=r) as fp:
for line in fp:
print line
fp.close()
=BEAUTIFY(response._vars)
}}

Can somebody suggest what could be issue?

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


[web2py] Re: list:string

2014-04-03 Thread Anthony
On Thursday, April 3, 2014 12:25:21 PM UTC-4, horridohobbyist wrote:

 Done. However, it didn't fix the issue, although I now see a tiny 
 clickable '+' and '-' right beside the input field for 'Shift:'. I have no 
 idea what that means. Clicking on them does nothing.


Check the JS console to see if any errors are produced. Clicking the + 
should add a new text box, and clicking the - should remove a box. If 
existing lists are not being populated, I suppose it's possible that the 
existing data are not stored correctly in the field. It might help to pack 
and attach a minimal app that reproduces the problem.
 

 It's also a little disturbing that I have to manually update my apps 
 whenever I upgrade web2py. *This is a disincentive for me to upgrade. My 
 motto is:  If it ain't broke, don't fix it.*


Well, in addition to bringing new features, upgrades typically include bug 
and security fixes, but if none of those matter to you, then of course you 
don't have to upgrade. Really, though, is it that much extra work to 
manually copy a couple of extra files? I think it's not done automatically 
because technically there does not have to be a fixed name or location for 
the app files (e.g., you could move or rename web2py.js or combine it with 
other JS files and minify). Upon upgrade, the only file you really have to 
worry about is web2py.js (i.e., because that works in conjunction with 
markup and CSS classes generated by the framework, things might break 
without the proper version). Old versions of appadmin.py and appadmin.html 
(and the generic views) should continue to work, though you may be missing 
new functionality or bug fixes if you don't upgrade those.

Anthony

-- 
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] GAE - Shell

2014-04-03 Thread Marcello
Hello,

I started to play with web2py and GAE.
I want to run a remote shell with something like:

python web2py.py -M -S app_name

But remotely... 

I looked everywhere but I did not find an answer...

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.


[web2py] Pyston

2014-04-03 Thread Massimo Di Pierro
This is really important!
https://tech.dropbox.com/2014/04/introducing-pyston-an-upcoming-jit-based-python-implementation/

Why is this important?
because finally a major technology company has committed to improve an 
already existing language that we love (Python) as opposed to inventing 
their own (Dart, Go, etc).
I trust something good will come out of this. Hopefully sooner rather than 
later.

Massimo 

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


[web2py] Re: gluon.rocket.SocketTimeout'(Socket timed out before request Error

2014-04-03 Thread Massimo Di Pierro
Code in view does not follow Python indentation rules. : opens a block. 
pass closes a block. So this:

with open(filename, mode=r) as fp:
for line in fp:
print line

should be

with open(filename, mode=r) as fp:
for line in fp:
print line
pass
pass

Clearly there is a bug in the parser since you should not get that error. 
You should get a error that says block not closed.

On Thursday, 3 April 2014 12:45:14 UTC-5, Ramesh Aj wrote:

 The Following code is giving gluon.rocket.SocketTimeout'(Socket timed 
 out before request error

 {{extend 'layout.html'}}
 {{import xml.etree.ElementTree as ET}}
 h1
 This is a Stations detail page
 /h1
 {{
 filename = xmlfile
 with open(filename, mode=r) as fp:
 for line in fp:
 print line
 fp.close()
 =BEAUTIFY(response._vars)
 }}

 Can somebody suggest what could be issue?


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


[web2py] Re: Web Editor Blank Screen

2014-04-03 Thread puercoespin
I have a similar problem...

With the latest  web2py_src (2.9.5), in localhost the web editor works as 
expected, but in my host, when i try to edit any file, i have the blank 
screen. 

Looking into  javascript console from chrome developers tool, displays a 
lot of 404:

GET 
https://https://162.249.6.221/admin/static/-2.9.5/codemirror/lib/codemirror.css
(mysite)https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css
/admin/static/-2.9.5/codemirror/lib/codemirror.csshttps://162.249.6.221/admin/static/-2.9.5/codemirror/lib/codemirror.css404
 (NOT FOUND) 
db.py?id=models__db__py:78https://162.249.6.221/admin/edit/welcome/models/db.py?id=models__db__py
GET 
https://https://162.249.6.221/admin/static/-2.9.5/codemirror/theme/web2py.css
(mysite)https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css
/admin/static/-2.9.5/codemirror/theme/web2py.csshttps://162.249.6.221/admin/static/-2.9.5/codemirror/theme/web2py.css404
 (NOT FOUND) 
db.py?id=models__db__py:79https://162.249.6.221/admin/edit/welcome/models/db.py?id=models__db__py
GET 
https://https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/dialog/dialog.css
(mysite)https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css/admin/static/-2.9.5/codemirror/addon/dialog/dialog.css
 
404 (NOT FOUND) 
db.py?id=models__db__py:96https://162.249.6.221/admin/edit/welcome/models/db.py?id=models__db__py
GET 
https://(mysite)/admin/static/-2.9.5/codemirror/addon/hint/show-hint.csshttps://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css404
 (NOT FOUND) 
etc.

I don't understand why the browser is looking for a -2.9.5/ directory that 
don't exist

How can i fix it? 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.


[web2py] Re: GAE - Shell

2014-04-03 Thread Massimo Di Pierro
Not possible.

On Thursday, 3 April 2014 13:25:23 UTC-5, Marcello wrote:

 Hello,

 I started to play with web2py and GAE.
 I want to run a remote shell with something like:

 python web2py.py -M -S app_name

 But remotely... 

 I looked everywhere but I did not find an answer...

 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.


[web2py] Re: list:string

2014-04-03 Thread Massimo Di Pierro
Usually you do not have to upgrade apps when you upgrade web2py. I can 
think of very few cases when we asked users to do it. In fact I think the 
only case in the last two years is when we asked to replace web2py.js in 
2.8. Moreover we never asked you to change the code. In the case in 
question, we only asked to replace one system file that you are not 
expected to edit anyway.

If I am missing something please let me know. 

Massimo


On Thursday, 3 April 2014 11:25:21 UTC-5, horridohobbyist wrote:

 Done. However, it didn't fix the issue, although I now see a tiny 
 clickable '+' and '-' right beside the input field for 'Shift:'. I have no 
 idea what that means. Clicking on them does nothing.

 It's also a little disturbing that I have to manually update my apps 
 whenever I upgrade web2py. *This is a disincentive for me to upgrade. My 
 motto is:  If it ain't broke, don't fix it.*


 On Thursday, 3 April 2014 11:55:23 UTC-4, Anthony wrote:

 While your at it, you may want to copy the appadmin.py controller and 
 appadmin.html views from the new welcome app into your app.

 Anthony

 On Thursday, April 3, 2014 11:54:28 AM UTC-4, Anthony wrote:

 Unless you explicitly copied the new web2py.js file from 
 /welcome/static/js to the /static/js folder of your existing app, then you 
 don't have the updated version of web2py.js.

 Anthony

 On Thursday, April 3, 2014 11:47:15 AM UTC-4, horridohobbyist wrote:

 I upgraded to web2py 2.9.4 recently. Unless the upgrade was corrupted, 
 I should be using the correct files. How can I tell if the web2py.js I 
 have 
 is correct or not? There's no identifying information.


 On Thursday, 3 April 2014 11:09:07 UTC-4, Anthony wrote:

 And you're sure you have the version of web2py.js associated with the 
 version of web2py you are running, and that it is loaded on the page?

 On Thursday, April 3, 2014 10:17:58 AM UTC-4, horridohobbyist wrote:

 db.define_table('products',
 Field('thumbnail', 
 'upload',uploadfield='image_data',represent=lambda v, r: 
 IMG(_src=URL('download',args=v))),
 Field('image_data', 'blob',readable=False),
 Field('name',unique=True,represent=lambda v, r: 
 A(v,_href=URL('view',args=[db.products,r.id])) + 
 XML('br'+r.description)),
 Field('category',represent=lambda v, r: 
 DIV(v,_style='width:75px;word-wrap:break-word;')),
 Field('description','text',represent=lambda v, r: ''),
 Field('choices','text',readable=False),
 Field('shift','list:string',readable=False),

 I initialize the field with .update(shift=['colour','size'])

 When I retrieve the field, I indeed can access the list items. 
 However, in admin, I see this:


 https://lh4.googleusercontent.com/-EfRWKJ_pUWQ/Uz1spRS9D0I/A40/H6TpxX6w7oM/s1600/Screen+Shot+2014-04-03+at+10.08.10+AM.png
 I know the data is in the field. Why can't I see it??


 On Thursday, 3 April 2014 09:37:41 UTC-4, Anthony wrote:

 Can we see some code (and maybe a screenshot of what you see)? The 
 default list:string widget requires an up-to-date web2py.js file.

 On Thursday, April 3, 2014 12:23:08 AM UTC-4, horridohobbyist wrote:

 I've added a 'list:string' field to my table, but when adding a new 
 record from admin (using the new record form), I can't figure out how 
 to 
 enter the data. I don't understand what format it expects.

 I tried ['item1','item2']. I tried |'item1'|'item2'|. They 
 both don't work.



-- 
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: list:string

2014-04-03 Thread horridohobbyist
What and where is the JS console??


On Thursday, 3 April 2014 14:11:02 UTC-4, Anthony wrote:

 On Thursday, April 3, 2014 12:25:21 PM UTC-4, horridohobbyist wrote:

 Done. However, it didn't fix the issue, although I now see a tiny 
 clickable '+' and '-' right beside the input field for 'Shift:'. I have no 
 idea what that means. Clicking on them does nothing.


 Check the JS console to see if any errors are produced. Clicking the + 
 should add a new text box, and clicking the - should remove a box. If 
 existing lists are not being populated, I suppose it's possible that the 
 existing data are not stored correctly in the field. It might help to pack 
 and attach a minimal app that reproduces the problem.
  

 It's also a little disturbing that I have to manually update my apps 
 whenever I upgrade web2py. *This is a disincentive for me to upgrade. My 
 motto is:  If it ain't broke, don't fix it.*


 Well, in addition to bringing new features, upgrades typically include bug 
 and security fixes, but if none of those matter to you, then of course you 
 don't have to upgrade. Really, though, is it that much extra work to 
 manually copy a couple of extra files? I think it's not done automatically 
 because technically there does not have to be a fixed name or location for 
 the app files (e.g., you could move or rename web2py.js or combine it with 
 other JS files and minify). Upon upgrade, the only file you really have to 
 worry about is web2py.js (i.e., because that works in conjunction with 
 markup and CSS classes generated by the framework, things might break 
 without the proper version). Old versions of appadmin.py and appadmin.html 
 (and the generic views) should continue to work, though you may be missing 
 new functionality or bug fixes if you don't upgrade those.

 Anthony


-- 
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: Simple question for registrations to filter bots

2014-04-03 Thread Thomas Wimmer
Yes like that, a simple question that is site-topic-related.

I use reCAPTCHA for other purposes than registration,
where i think a lower wall would be better than the sometimes anoying 
captchas.

If no one has a better idea i will cascade the registration,
by putting the question into a form before the register-form.

Thanks for your 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: Web Editor Blank Screen

2014-04-03 Thread Dave S


On Thursday, April 3, 2014 11:46:15 AM UTC-7, puercoespin wrote:

 I have a similar problem...

 With the latest  web2py_src (2.9.5), in localhost the web editor works as 
 expected, but in my host, when i try to edit any file, i have the blank 
 screen. 

 Looking into  javascript console from chrome developers tool, displays a 
 lot of 404:
 
 GET 
 https://https://162.249.6.221/admin/static/-2.9.5/codemirror/lib/codemirror.css
 (mysite)https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css
 /admin/static/-2.9.5/codemirror/lib/codemirror.csshttps://162.249.6.221/admin/static/-2.9.5/codemirror/lib/codemirror.css404
  (NOT FOUND) 
 db.py?id=models__db__py:78https://162.249.6.221/admin/edit/welcome/models/db.py?id=models__db__py
 GET 
 https://https://162.249.6.221/admin/static/-2.9.5/codemirror/theme/web2py.css
 (mysite)https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css
 /admin/static/-2.9.5/codemirror/theme/web2py.csshttps://162.249.6.221/admin/static/-2.9.5/codemirror/theme/web2py.css404
  (NOT FOUND) 
 db.py?id=models__db__py:79https://162.249.6.221/admin/edit/welcome/models/db.py?id=models__db__py
 GET 
 https://https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/dialog/dialog.css
 (mysite)https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css/admin/static/-2.9.5/codemirror/addon/dialog/dialog.css
  
 404 (NOT FOUND) 
 db.py?id=models__db__py:96https://162.249.6.221/admin/edit/welcome/models/db.py?id=models__db__py
 GET 
 https://(mysite)/admin/static/-2.9.5/codemirror/addon/hint/show-hint.csshttps://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css404
  (NOT FOUND) 
 etc.

 I don't understand why the browser is looking for a -2.9.5/ directory that 
 don't exist


I think this is how web2py deals with versioning of static files, in a way 
that updates browser caches reasonably.
Niphlod described this not long ago, in
https://groups.google.com/d/msg/web2py/e9H7renfH7U/C7VI3DFC0Z8J
but it has been around for a while.


 


 How can i fix it? thanks
  


What do you have in your routes.py?

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


Re: [web2py] Pyston

2014-04-03 Thread Michele Comitini
since python's BDFL is also working in that company, that's really important.

2014-04-03 20:41 GMT+02:00 Massimo Di Pierro massimo.dipie...@gmail.com:
 This is really important!
 https://tech.dropbox.com/2014/04/introducing-pyston-an-upcoming-jit-based-python-implementation/

 Why is this important?
 because finally a major technology company has committed to improve an
 already existing language that we love (Python) as opposed to inventing
 their own (Dart, Go, etc).
 I trust something good will come out of this. Hopefully sooner rather than
 later.

 Massimo

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

-- 
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: list:string

2014-04-03 Thread horridohobbyist
For some reason, it's suddenly working with the newer web2py.js. Weird.


On Thursday, 3 April 2014 14:11:02 UTC-4, Anthony wrote:

 On Thursday, April 3, 2014 12:25:21 PM UTC-4, horridohobbyist wrote:

 Done. However, it didn't fix the issue, although I now see a tiny 
 clickable '+' and '-' right beside the input field for 'Shift:'. I have no 
 idea what that means. Clicking on them does nothing.


 Check the JS console to see if any errors are produced. Clicking the + 
 should add a new text box, and clicking the - should remove a box. If 
 existing lists are not being populated, I suppose it's possible that the 
 existing data are not stored correctly in the field. It might help to pack 
 and attach a minimal app that reproduces the problem.
  

 It's also a little disturbing that I have to manually update my apps 
 whenever I upgrade web2py. *This is a disincentive for me to upgrade. My 
 motto is:  If it ain't broke, don't fix it.*


 Well, in addition to bringing new features, upgrades typically include bug 
 and security fixes, but if none of those matter to you, then of course you 
 don't have to upgrade. Really, though, is it that much extra work to 
 manually copy a couple of extra files? I think it's not done automatically 
 because technically there does not have to be a fixed name or location for 
 the app files (e.g., you could move or rename web2py.js or combine it with 
 other JS files and minify). Upon upgrade, the only file you really have to 
 worry about is web2py.js (i.e., because that works in conjunction with 
 markup and CSS classes generated by the framework, things might break 
 without the proper version). Old versions of appadmin.py and appadmin.html 
 (and the generic views) should continue to work, though you may be missing 
 new functionality or bug fixes if you don't upgrade those.

 Anthony


-- 
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: list:string

2014-04-03 Thread Dave S
On Thursday, April 3, 2014 11:57:27 AM UTC-7, horridohobbyist wrote:

 What and where is the JS console??


Browser-dependent, isn't it?  In FF 18.something, it's Tools-Web 
Developer-Web Console, and then pick the proper tab in the subwindow that 
starts up.  Chrome has different menu layout.

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


Re: [web2py] Pyston

2014-04-03 Thread Michele Comitini
@Massimo,
 you will be happy to know that: Pyston currently targets Python 2.7...

https://github.com/dropbox/pyston

2014-04-03 21:41 GMT+02:00 Michele Comitini michele.comit...@gmail.com:
 since python's BDFL is also working in that company, that's really important.

 2014-04-03 20:41 GMT+02:00 Massimo Di Pierro massimo.dipie...@gmail.com:
 This is really important!
 https://tech.dropbox.com/2014/04/introducing-pyston-an-upcoming-jit-based-python-implementation/

 Why is this important?
 because finally a major technology company has committed to improve an
 already existing language that we love (Python) as opposed to inventing
 their own (Dart, Go, etc).
 I trust something good will come out of this. Hopefully sooner rather than
 later.

 Massimo

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

-- 
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: after_update callback question

2014-04-03 Thread Anthony
Hmm, I have tried both methods (assigning a global variable and adding an 
attribute to current), and in both cases it works fine (i.e., with the 
callback defined and set in a model file and with the update happening in a 
controller function). Perhaps you could attach a minimal app that 
reproduces your problem.

Anthony

On Thursday, April 3, 2014 11:53:47 AM UTC-4, mcamel wrote:

 Sorry, i wanted to say 'model' not 'module'.

 I've tried to pass data from a callback in a model to its function in a 
 controller with 'current', but was not able:

 def my_before_callback():
 from gluon import current
 current._mydata = 'hello'

 In a controller:

 def my_function():
 db.update()
 from gluon import current
 response.flash = current._mydata

 but got error:

 type 'exceptions.AttributeError' 'thread._local' object has no 
 attribute '_mydata'


 I'm doing something wrong or it's just that it applies only for modules 
 and not for models and/or controllers?.

 I'm sure the callback is called because all works if i replace 'current' 
 with 'request.vars'.


 Thanks for your time.


 El jueves, 3 de abril de 2014 17:10:57 UTC+2, Anthony escribió:

 On Thursday, April 3, 2014 10:58:32 AM UTC-4, mcamel wrote:


 Be careful about storing something in request.vars, as some other code 
 may depend on request.vars and end up failing due to it being changed.


 Any alternative you can suggest?. Session object seems error prone for 
 this because of concurrency...


 You could just declare a global variable:


 That works fine to pass values from 'before' callback to 'after' 
 callback, but fails if you want to pass values from 'after' callback (in a 
 module) to the function that triggered it (in a controller).


 That's a different story. In that case, you could add something to 
 current.

 Anthony 



-- 
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: Install in hostgator

2014-04-03 Thread RTBS
In Hostgator's CPanel there is error logs area.  When i try to load the 
page, I get a 500 error in the browser and the following errors in the 
CPanel error log:

  File /home4/username/local/web2py/gluon/contrib/pbkdf2_ctypes.py, 
line 22, in module
  File /home4/username/local/web2py/gluon/utils.py, line 46, in module
  File /home4/username/local/web2py/gluon/html.py, line 31, in module
  File /home4/username/local/web2py/gluon/globals.py, line 21, in 
module
  File /home4/username/local/web2py/gluon/__init__.py, line 15, in 
module

I have created a virtualenv called local and unzipped my web2py package in 
local.  This looks like it fails to import some packages basked on the 
lines where the issues occur.

Does my python path need to be altered?



On Tuesday, April 1, 2014 11:02:21 AM UTC-7, RTBS wrote:

 To try to narrow down where my error is I executed my *.fcgi file.  Please 
 see below.  I still get Error 500 when visiting the domain.  How do these 
 parameters get set?


 [~/public_html]# ./dispatch.fcgi
 WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
 WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
 WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
 WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
 Status: 303 SEE OTHER
 Content-Type: text/html; charset=UTF-8
 Location: /web2py/welcome/default/index
 Content-Length: 73

 You are being redirected a href=/web2py/welcome/default/indexhere/a





 On Monday, March 24, 2014 12:56:44 PM UTC-7, RTBS wrote:

 When I used your commands, I got python2.6 in my virtualenv.

 

 To specify python2.7, rather than python2.6, in the virtualenv see below.
 In my example '/home/USER/python' == 'path to your new virtualenv'

 1) 
 virtualenv -p /usr/local/bin/python2.7 path to your new virtualenv

 2) 
 source path to your new virtualenv/bin/activate

 3) 
 pip install flup

 4) 
 deactivate
 This is the command to leave your virtualenv.  To re-enter, use the 
 command in #2.
 

 My project does not load (Error 500).  From reading this forum, I think 
 these are the required steps.  Is this correct?

 1. create a virtualenv and install flup
 2. create a file '.htaccess' in the 'public_html' directory
   2.1 edit content in /home4/USER/public_html/.htaccess
 3. create a file 'index.fcgi' in the public_html' directory
   3.1 edit content in /home4/USER/public_html/index.fcgi
 4. make the index.fcgi file executable (I used cpanel 'File Manager' to 
 set the permissions on this file to 755)
 5. Download the source code for web2py from the web2py website.
http://www.web2py.com/examples/static/web2py_src.zip
   5.1 FTP or SCP the zip file to your /home4/USER directory
   5.2 Use the unzip command to put web2py at /home4/USER/web2py
 6. Copy the 'routespatterns.example.py' file from 
 /home4/USER/web2py/examples to /home4/USER/web2py
   6.1 rename the file 'routes.patterns.example.py' to 'routes.py'
   6.2 edit content in /home4/USER/web2py/routes.py

 

 I sent a ticket to their support team about utilizing mod_wsgi or fcgi, 
 knowing that web2py would not be supported.  Will this even work with the 
 'Hatchling' package?  Perhaps I am wasting my time and need to change 
 hosting providers.

 From my support ticket:
 Currently, our Reseller and Shared plans (Hatchling, Baby, and Business) 
 are set up with suPHP, and would require an upgrade if you needed to use a 
 different handler. We have Apache 2.2 and 2.4 available for our VPS and 
 Dedicated servers, and Apache 2.2 for our shared environment.

 In order to use fcgi or mod_wsgi, it is required that you upgrade to 
 either a VPS or a Dedicated server solution. Both of these packages allow 
 for custom configuration of nearly any aspect of your server, and give you 
 full control over your software. 

 Any pointers would be appreciated. Thanks!

 On Friday, January 31, 2014 9:36:47 AM UTC-8, desta wrote:

 I am writing to update this method. We have followed the instructions 
 included above but we kept getting an internal server error 500.

 The problem was that we had no experience how virtualenv works! So first 
 you need to create one with the following command:
 virtualenv /home/USER/python

 The problem was here, that this virtualenv missing the flup module. So 
 to install you first need to run
 source /home/USER/python/bin/activate

 and then run

 pip install flup


 After that, it should work. Make sure you run the instructions from the 
 previous posts.

 I hope this helps someone.

 On Wednesday, April 17, 2013 8:28:07 PM UTC+3, Diogo Munaro wrote:

 Thx man! You help me a lot!!

 Em sábado, 14 de maio de 2011 01h21min13s UTC-3, José Eloy escreveu:

 Hello! 

 Recently a customer bought a hosting plan (business) with hostgator. 
 I'm developing for him a web2py application, I have doubts of how to 
 deploy it. Somebody can help me? The 

[web2py] Re: web2py-mini-conference, May 4, 2014

2014-04-03 Thread Massimo Di Pierro
Registration is closed. We exceeded room capacity. We have sponsors, 
volunteers, talks proposals, and a lot of work ahead of us. It is going to 
be great.
We will do our best to record everything.

Massimo

On Monday, 3 March 2014 09:36:29 UTC-6, Massimo Di Pierro wrote:

 We have a date, a location, and a web site:

  http://www.experts4solutions.com/web2py_conference

 Please register if you plan to attend.
 The more the merrier. We are looking for sponsors.

 Massimo


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


[web2py] Re: list:string

2014-04-03 Thread Anthony
Perhaps your browser had the older JS file cached.

On Thursday, April 3, 2014 3:43:08 PM UTC-4, horridohobbyist wrote:

 For some reason, it's suddenly working with the newer web2py.js. Weird.


 On Thursday, 3 April 2014 14:11:02 UTC-4, Anthony wrote:

 On Thursday, April 3, 2014 12:25:21 PM UTC-4, horridohobbyist wrote:

 Done. However, it didn't fix the issue, although I now see a tiny 
 clickable '+' and '-' right beside the input field for 'Shift:'. I have no 
 idea what that means. Clicking on them does nothing.


 Check the JS console to see if any errors are produced. Clicking the + 
 should add a new text box, and clicking the - should remove a box. If 
 existing lists are not being populated, I suppose it's possible that the 
 existing data are not stored correctly in the field. It might help to pack 
 and attach a minimal app that reproduces the problem.
  

 It's also a little disturbing that I have to manually update my apps 
 whenever I upgrade web2py. *This is a disincentive for me to upgrade. 
 My motto is:  If it ain't broke, don't fix it.*


 Well, in addition to bringing new features, upgrades typically include 
 bug and security fixes, but if none of those matter to you, then of course 
 you don't have to upgrade. Really, though, is it that much extra work to 
 manually copy a couple of extra files? I think it's not done automatically 
 because technically there does not have to be a fixed name or location for 
 the app files (e.g., you could move or rename web2py.js or combine it with 
 other JS files and minify). Upon upgrade, the only file you really have to 
 worry about is web2py.js (i.e., because that works in conjunction with 
 markup and CSS classes generated by the framework, things might break 
 without the proper version). Old versions of appadmin.py and appadmin.html 
 (and the generic views) should continue to work, though you may be missing 
 new functionality or bug fixes if you don't upgrade those.

 Anthony



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

2014-04-03 Thread Massimo Di Pierro
Long live 2.7 (2.8, 2.9, etc.)

On Thursday, 3 April 2014 14:55:49 UTC-5, Michele Comitini wrote:

 @Massimo, 
  you will be happy to know that: Pyston currently targets Python 2.7... 

 https://github.com/dropbox/pyston 

 2014-04-03 21:41 GMT+02:00 Michele Comitini michele.comit...@gmail.com: 
  since python's BDFL is also working in that company, that's really 
 important. 
  
  2014-04-03 20:41 GMT+02:00 Massimo Di Pierro massimo.dipie...@gmail.com: 

  This is really important! 
  
 https://tech.dropbox.com/2014/04/introducing-pyston-an-upcoming-jit-based-python-implementation/
  
  
  Why is this important? 
  because finally a major technology company has committed to improve an 
  already existing language that we love (Python) as opposed to inventing 
  their own (Dart, Go, etc). 
  I trust something good will come out of this. Hopefully sooner rather 
 than 
  later. 
  
  Massimo 
  
  -- 
  Resources: 
  - http://web2py.com 
  - http://web2py.com/book (Documentation) 
  - http://github.com/web2py/web2py (Source code) 
  - https://code.google.com/p/web2py/issues/list (Report Issues) 
  --- 
  You received this message because you are subscribed to the Google 
 Groups 
  web2py-users group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to web2py+unsubscr...@googlegroups.com. 
  For more options, visit https://groups.google.com/d/optout. 


-- 
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: Web Editor Blank Screen

2014-04-03 Thread puercoespin
routes.py

routers = dict(

# base router
BASE=dict(
default_application='egasolineras',
applications = 'ALL',
root_static = ['favicon.ico', 'robots.txt', 'sitemap.xml'],
map_hyphen = True,
),
)


El jueves, 3 de abril de 2014 21:30:51 UTC+2, Dave S escribió:



 On Thursday, April 3, 2014 11:46:15 AM UTC-7, puercoespin wrote:

 I have a similar problem...

 With the latest  web2py_src (2.9.5), in localhost the web editor works as 
 expected, but in my host, when i try to edit any file, i have the blank 
 screen. 

 Looking into  javascript console from chrome developers tool, displays a 
 lot of 404:
 
 GET 
 https://https://162.249.6.221/admin/static/-2.9.5/codemirror/lib/codemirror.css
 (mysite)https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css
 /admin/static/-2.9.5/codemirror/lib/codemirror.csshttps://162.249.6.221/admin/static/-2.9.5/codemirror/lib/codemirror.css404
  (NOT FOUND) 
 db.py?id=models__db__py:78https://162.249.6.221/admin/edit/welcome/models/db.py?id=models__db__py
 GET 
 https://https://162.249.6.221/admin/static/-2.9.5/codemirror/theme/web2py.css
 (mysite)https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css
 /admin/static/-2.9.5/codemirror/theme/web2py.csshttps://162.249.6.221/admin/static/-2.9.5/codemirror/theme/web2py.css404
  (NOT FOUND) 
 db.py?id=models__db__py:79https://162.249.6.221/admin/edit/welcome/models/db.py?id=models__db__py
 GET 
 https://https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/dialog/dialog.css
 (mysite)https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css/admin/static/-2.9.5/codemirror/addon/dialog/dialog.css
  
 404 (NOT FOUND) 
 db.py?id=models__db__py:96https://162.249.6.221/admin/edit/welcome/models/db.py?id=models__db__py
 GET 
 https://(mysite)/admin/static/-2.9.5/codemirror/addon/hint/show-hint.csshttps://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css404
  (NOT FOUND) 
 etc.

 I don't understand why the browser is looking for a -2.9.5/ directory 
 that don't exist


 I think this is how web2py deals with versioning of static files, in a way 
 that updates browser caches reasonably.
 Niphlod described this not long ago, in
 https://groups.google.com/d/msg/web2py/e9H7renfH7U/C7VI3DFC0Z8J
 but it has been around for a while.


  


 How can i fix it? thanks
  


 What do you have in your routes.py?

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


Re: [web2py] Re: memory leak?

2014-04-03 Thread Rick Ree
So, I'm pretty sure I was mistaken about this being a memory leak. My app 
had a bug in which a SELECT form field (options widget) was being populated 
by hundreds of thousands of items from the db. This caused memory use to 
exceed server limits when the view was rendered multiple times in rapid 
succession. In the absence of this, garbage collection does seem to proceed 
normally. Sorry for the confusion.

On Wednesday, April 2, 2014 4:59:43 AM UTC-5, Rick Ree wrote:

 Yes, the leak seems to be associated with rendering data in a view.
 On Apr 2, 2014 3:57 AM, Paolo Valleri paolo.vall...@gmail.com wrote:

 I run nearly the same example:
 def f():
 a=list(range(10))
 return 'ok'
 After about 200 downloads the web2py process grew up to 100M. Tested on a 
 system with 8Gb ram, ubuntu 12.04

 paolo

 On Wednesday, April 2, 2014 5:57:51 AM UTC+2, Rick Ree wrote:

 Ubuntu 12.04 and 13.10. I'm running web2py from the git repo, but 
 observed this in 2.8.2 as well.

 On Tuesday, April 1, 2014 10:40:55 PM UTC-5, Massimo Di Pierro wrote:

 This should not be happening. What OS? What wev2py version?

 On Tuesday, 1 April 2014 10:00:08 UTC-5, Rick Ree wrote:

 Hi,

 If I create a new app and put a single function in default.py:

 def f():
 return dict(a=list(range(10)))

 and then repeatedly call this using wget, e.g. wget 
 http://localhost:8000/default/f.html, then memory usage of web2py 
 will creep higher with each call. Is this a memory leak, or will the 
 memory 
 eventually be reclaimed? Is there something I can do in f() to avoid this?

 thanks,
 -Rick

  -- 
 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/_cB4Ibm5ilc/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: Simple question for registrations to filter bots

2014-04-03 Thread Rob Mayhue
Lately I've been taking the opposite approach. I add a field that should 
always be empty and use CSS to set the field to `display: none; `.

When the form is submitted if that field contains a value, its probably 
spam. Usually a bot will POST values for all the fields that were found.

-- 
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: Web Editor Blank Screen

2014-04-03 Thread puercoespin
After reading the links  you posted, i can see that my problem is in 
map_hyphen = True. In False, works well

But it's very important for me (and for Google) that my urls was with '-', 
and not with '_' . What can I do for compatibility the map_hyphen = True, 
with the versioning static files in web2py?

Thanks 
 



El jueves, 3 de abril de 2014 22:33:33 UTC+2, puercoespin escribió:

 routes.py

 routers = dict(

 # base router
 BASE=dict(
 default_application='egasolineras',
 applications = 'ALL',
 root_static = ['favicon.ico', 'robots.txt', 'sitemap.xml'],
 map_hyphen = True,
 ),
 )


 El jueves, 3 de abril de 2014 21:30:51 UTC+2, Dave S escribió:



 On Thursday, April 3, 2014 11:46:15 AM UTC-7, puercoespin wrote:

 I have a similar problem...

 With the latest  web2py_src (2.9.5), in localhost the web editor works 
 as expected, but in my host, when i try to edit any file, i have the blank 
 screen. 

 Looking into  javascript console from chrome developers tool, displays 
 a lot of 404:
 
 GET 
 https://https://162.249.6.221/admin/static/-2.9.5/codemirror/lib/codemirror.css
 (mysite)https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css
 /admin/static/-2.9.5/codemirror/lib/codemirror.csshttps://162.249.6.221/admin/static/-2.9.5/codemirror/lib/codemirror.css404
  (NOT FOUND) 
 db.py?id=models__db__py:78https://162.249.6.221/admin/edit/welcome/models/db.py?id=models__db__py
 GET 
 https://https://162.249.6.221/admin/static/-2.9.5/codemirror/theme/web2py.css
 (mysite)https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css
 /admin/static/-2.9.5/codemirror/theme/web2py.csshttps://162.249.6.221/admin/static/-2.9.5/codemirror/theme/web2py.css404
  (NOT FOUND) 
 db.py?id=models__db__py:79https://162.249.6.221/admin/edit/welcome/models/db.py?id=models__db__py
 GET 
 https://https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/dialog/dialog.css
 (mysite)https://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css/admin/static/-2.9.5/codemirror/addon/dialog/dialog.css
  
 404 (NOT FOUND) 
 db.py?id=models__db__py:96https://162.249.6.221/admin/edit/welcome/models/db.py?id=models__db__py
 GET 
 https://(mysite)/admin/static/-2.9.5/codemirror/addon/hint/show-hint.csshttps://162.249.6.221/admin/static/-2.9.5/codemirror/addon/hint/show-hint.css404
  (NOT FOUND) 
 etc.

 I don't understand why the browser is looking for a -2.9.5/ directory 
 that don't exist


 I think this is how web2py deals with versioning of static files, in a 
 way that updates browser caches reasonably.
 Niphlod described this not long ago, in
 https://groups.google.com/d/msg/web2py/e9H7renfH7U/C7VI3DFC0Z8J
 but it has been around for a while.


  


 How can i fix it? thanks
  


 What do you have in your routes.py?

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


[web2py] Re: Simple question for registrations to filter bots

2014-04-03 Thread Niphlod
little bit overkill for what you're proposing, but hey. another tool in 
the toolbelt 

https://github.com/niphlod/w2p_SFS_plugin

^__^

On Thursday, April 3, 2014 11:28:49 PM UTC+2, Rob Mayhue wrote:

 Lately I've been taking the opposite approach. I add a field that should 
 always be empty and use CSS to set the field to `display: none; `.

 When the form is submitted if that field contains a value, its probably 
 spam. Usually a bot will POST values for all the fields that were found.



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

2014-04-03 Thread Tim Richardson


On Friday, April 4, 2014 7:19:37 AM UTC+11, Massimo Di Pierro wrote:

 Long live 2.7 (2.8, 2.9, etc.)


I'm convinced we'll never see a 2.8. Some very strong statements have been 
made. Python 3.3 and 3.4 are a bit more retro though. 

-- 
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: Book layout appears broken

2014-04-03 Thread Tim Richardson
it still hasn't rebuilt, but the fixing patch went in. You can clone the 
git repository for a local copy of the book (accesses via a running web2py 
instance). 
Or look at this one: 
https://do.growthpath.com.au/book/default/chapter/29

On Thursday, April 3, 2014 11:23:30 PM UTC+11, Louis Amon wrote:

 It doesn't look like it's fixed (or at least not online)


 http://web2py.com/books/default/chapter/29/09/access-control#Renaming-Auth-tables


 I'll stick to the printed version for now

 On Wednesday, March 12, 2014 4:34:30 AM UTC+1, Tim Richardson wrote:

 And fixed now. Sorry, that was my bad.

 On Wednesday, 12 March 2014 11:43:50 UTC+11, Tim Richardson wrote:

 Yes,
 there is a PR to fix it.


 On Wednesday, 12 March 2014 00:12:32 UTC+11, Remco Boerma wrote:


 http://web2py.com/books/default/chapter/29/09/access-control#Renaming-Auth-tables
  

 There's a screwup of the layout starting somewhere in that section. 


 -- 
 Cheers / Met vr. gr. 
 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/d/optout.


[web2py] Re: Simple question for registrations to filter bots

2014-04-03 Thread Thomas Wimmer
This idea is much better. Thanks a lot!

Am Donnerstag, 3. April 2014 23:28:49 UTC+2 schrieb Rob Mayhue:

 Lately I've been taking the opposite approach. I add a field that should 
 always be empty and use CSS to set the field to `display: none; `.

 When the form is submitted if that field contains a value, its probably 
 spam. Usually a bot will POST values for all the fields that were found.



-- 
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: memory leak?

2014-04-03 Thread Massimo Di Pierro
Better a false positive than an un-reported bug. :-)

On Thursday, 3 April 2014 16:12:59 UTC-5, Rick Ree wrote:

 So, I'm pretty sure I was mistaken about this being a memory leak. My app 
 had a bug in which a SELECT form field (options widget) was being populated 
 by hundreds of thousands of items from the db. This caused memory use to 
 exceed server limits when the view was rendered multiple times in rapid 
 succession. In the absence of this, garbage collection does seem to proceed 
 normally. Sorry for the confusion.

 On Wednesday, April 2, 2014 4:59:43 AM UTC-5, Rick Ree wrote:

 Yes, the leak seems to be associated with rendering data in a view.
 On Apr 2, 2014 3:57 AM, Paolo Valleri paolo.vall...@gmail.com wrote:

 I run nearly the same example:
 def f():
 a=list(range(10))
 return 'ok'
 After about 200 downloads the web2py process grew up to 100M. Tested on 
 a system with 8Gb ram, ubuntu 12.04

 paolo

 On Wednesday, April 2, 2014 5:57:51 AM UTC+2, Rick Ree wrote:

 Ubuntu 12.04 and 13.10. I'm running web2py from the git repo, but 
 observed this in 2.8.2 as well.

 On Tuesday, April 1, 2014 10:40:55 PM UTC-5, Massimo Di Pierro wrote:

 This should not be happening. What OS? What wev2py version?

 On Tuesday, 1 April 2014 10:00:08 UTC-5, Rick Ree wrote:

 Hi,

 If I create a new app and put a single function in default.py:

 def f():
 return dict(a=list(range(10)))

 and then repeatedly call this using wget, e.g. wget 
 http://localhost:8000/default/f.html, then memory usage of web2py 
 will creep higher with each call. Is this a memory leak, or will the 
 memory 
 eventually be reclaimed? Is there something I can do in f() to avoid 
 this?

 thanks,
 -Rick

  -- 
 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/_cB4Ibm5ilc/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: Book layout appears broken

2014-04-03 Thread Massimo Di Pierro
Sorry. it still being cached. Will restart tomorrow.

On Thursday, 3 April 2014 18:37:04 UTC-5, Tim Richardson wrote:

 it still hasn't rebuilt, but the fixing patch went in. You can clone the 
 git repository for a local copy of the book (accesses via a running web2py 
 instance). 
 Or look at this one: 
 https://do.growthpath.com.au/book/default/chapter/29

 On Thursday, April 3, 2014 11:23:30 PM UTC+11, Louis Amon wrote:

 It doesn't look like it's fixed (or at least not online)


 http://web2py.com/books/default/chapter/29/09/access-control#Renaming-Auth-tables


 I'll stick to the printed version for now

 On Wednesday, March 12, 2014 4:34:30 AM UTC+1, Tim Richardson wrote:

 And fixed now. Sorry, that was my bad.

 On Wednesday, 12 March 2014 11:43:50 UTC+11, Tim Richardson wrote:

 Yes,
 there is a PR to fix it.


 On Wednesday, 12 March 2014 00:12:32 UTC+11, Remco Boerma wrote:


 http://web2py.com/books/default/chapter/29/09/access-control#Renaming-Auth-tables
  

 There's a screwup of the layout starting somewhere in that section. 


 -- 
 Cheers / Met vr. gr. 
 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/d/optout.


[web2py] Smartgrid and archive buttons

2014-04-03 Thread Seth J
Hi guys,

New to web2py and have a potentially simple question about smartgrid.

In db.py I have an archive enabled after definition of my 'work_log' 
table:

## after defining tables, uncomment below to enable auditing
auth.enable_record_versioning(db)

in default.py controller I have the following:

@auth.requires_login()
def work_log_manage():
is_owner = (lambda row: row.created_by == auth.user_id) if auth.user 
else False  #Determine if user is an owner of a record
db.work_log.id.readable=False # Since we do not want to expose the id 
field on the grid
db.work_log_archive.id.readable=False # Since we do not want to expose 
the id field on the grid
db.work_log.created_by.readable=True # Show owner of a record
orderby = ['created_on']  # Order by record creation date
grid = SQLFORM.smartgrid(db.work_log, editable=is_owner, 
deletable=is_owner, user_signature=True, paginate=30, 
maxtextlengths={'work_log.f_job_title_format_no':50}, orderby=orderby)
return dict(grid=grid)

The goal is for each user to only be able to edit or delete his/her own 
record.  It works perfectly 

https://lh3.googleusercontent.com/-0ZOMoy7jcys/Uz3Y-BLpZrI/BeE/DdFGkUwEpN8/s1600/work_log.png
As you can see there's Work log archives link before the button.  When I 
click on it, it takes me to an archive for that record and they have the 
same buttons attached to the right of every 'version'.  How do I disable 
all buttons only in an archive table?  Also, is there a way to change the 
wording on that link to something different than Work log archives in 
smartgrid?

-- 
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] JSON data in HTML web page

2014-04-03 Thread Ramesh Aj
I am reading data from remote machine and converting it into dictionary 
format
like 
 {IP: [192.111.111.111, 222.222.222.222, 333.333.333.333], MAC: 
[aa:aa:aa:aa, bb:bb:bb:bb, cc:cc:cc:cc], conn: [wireless, wireless, 
wireless]}

I am sending this dictionary to view which is index.html where I am dumping 
this as json.dumps(mydict)

Now, I want to take this json data and format in a specific way so that I 
can display on html page (index.html)

How would I do that ? Can I write jquery in index.html(view) or how would I 
read json data and print it in proper readable format ?

Thanks !

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


Re: [web2py] Re: Scheduler - clarification around heartbeat, and setting up tasks

2014-04-03 Thread Kiran Subbaraman

  
  
Ah, yes that is the point I missed from
  Anthony's post. Thanks for highlighting it Niphlod. 
  
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
  On Thu, 03-04-2014 9:40 PM, Niphlod wrote:


  that is probably due to the fact that you're
calling "queue_task" inside a model, so you get a new queued
task EVERY request that comes in.
As said by Anthony, remove the "queue_task" bit from your
  model and put them in a controller, else queue the task from
  appadmin.
  
  On Thursday, April 3, 2014 5:17:02 PM UTC+2, Kiran Subbaraman
  wrote:
  
Thanks for the information; and also the example around
  queuing the tasks in such way that they are called in a
  specific time-bound sequence. I am not trying to do that,
  but just focusing on adding the tasks to the scheduler so
  that they get executed. Sequencing doesn't matter now.
  
  What I wanted to understand was the debug log output,
  which shows tasks (or its worker) being "executed" every
  0.5 to 1 second intervals. Does that mean that the queue
  db from which they pick up the tasks is accessed every
  second or so? And this is on the configuration where I
  haven't set the period/repeats configuration. I guess I
  will try Anthony and your suggestion to explore that
  option. Will report what I find in the debug log then. 
  
  2014-04-01 23:36:16,642 - web2py.app.myapp - DEBUG -    result: "Done: Task A"
2014-04-01 23:36:17,407 - web2py.app.myapp - DEBUG -     new task report: COMPLETED
2014-04-01 23:36:17,408 - web2py.app.myapp - DEBUG -    result: "Done: Task B"
2014-04-01 23:36:18,180 - web2py.app.myapp - DEBUG -     new task report: COMPLETED
2014-04-01 23:36:18,180 - web2py.app.myapp - DEBUG -    result: "Done: Task C"
2014-04-01 23:36:18,944 - web2py.app.myapp - DEBUG -     new task report: COMPLETED
2014-04-01 23:36:18,944 - web2py.app.myapp - DEBUG -    result: "Done: Task A"

  


  

  
  -- 
  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] JSON data in HTML web page

2014-04-03 Thread Martin Weissenboeck
​I am not sure ... did you mean:
​

​def index():
d = {IP: [192.111.111.111, 222.222.222.222, 333.333.333.333],
MAC: [aa:aa:aa:aa, bb:bb:bb:bb, cc:cc:cc:cc],
conn: [wireless, wireless, wireless]}
return d

index.html:

{{extend 'layout.html'}}
{{for ip,mac,c in zip(IP,MAC,conn):}}
{{=ip}}
{{=mac}}
{{=c}}
br/
{{pass}}

The output is:

192.111.111.111 aa:aa:aa:aa wireless
222.222.222.222 bb:bb:bb:bb wireless
333.333.333.333 cc:cc:cc:cc wireless ​


​Regards, Martin

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