[web2py] Which free email service works fine with web2py?

2016-05-23 Thread Steve Joe
I used to use gmail. Had a lot of struggle and one fine day it started 
working. Now again it doesn't work. I get no emails!

-- 
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: Create SQLFORM having one submit button for 2 distinct tables

2016-05-23 Thread Mohit Jain
Thanks Anthony for your suggestion! Works just fine :)

For anyone looking at a similar problem, here's what I've done now.

form = SQLFORM.factory(
Field('appStart','datetime',label='App-Period Start Time'),
Field('appEnd','datetime',label='App-Period End Time'),
Field('nomStart','datetime',label='Nom-Period Start Time'),
Field('nomEnd','datetime',label='Nom-Period End Time')
   )

if form.process().accepted:
app_msg_flash = 'Application Period Unchanged'
nom_msg_flash = 'Nomination Period Unchanged'
if form.vars.appStart:
if not form.vars.appEnd:
session.flash = 'Application Period End-Time not specified!'
redirect(URL('overall_admin','set_deadline'))
else:
db.AppDeadline.insert(start=form.vars.appStart, 
end=form.vars.appEnd)
db.UserLogs.insert(activity='Application Period Set : 
'+str(form.vars.appStart)+' to '+str(form.vars.appEnd))
app_msg_flash = 'Application Period Set : 
'+str(form.vars.appStart)+' to '+str(form.vars.appEnd)
elif form.vars.appEnd:
session.flash = 'Application Period Start-Time not specified!'
redirect(URL('overall_admin','set_deadline'))
if form.vars.nomStart:
if not form.vars.nomEnd:
session.flash = 'Nomination Period End-Time not specified!'
redirect(URL('overall_admin','set_deadline'))
else:
db.NomDeadline.insert(start=form.vars.nomStart, 
end=form.vars.nomEnd)
db.UserLogs.insert(activity='Nomination Period Set : 
'+str(form.vars.nomStart)+' to '+str(form.vars.nomEnd))
nom_msg_flash = 'Nomination Period Set : 
'+str(form.vars.nomStart)+' to '+str(form.vars.nomEnd)
elif form.vars.nomEnd:
session.flash = 'Nomination Period Start-Time not specified!'
redirect(URL('overall_admin','set_deadline'))

response.flash = DIV(app_msg_flash,BR(),nom_msg_flash)
elif form.errors:
response.flash = 'Deadlines not Set : Form has error(s)!'



On Sunday, May 22, 2016 at 11:31:27 PM UTC+5:30, Mohit Jain wrote:
>
> Hello,
> I have 2 tables (ApplicationDeadline & NominationDeadline). Both of 
> them have only 2 fields (start-time and end-time). I would like to create a 
> form where the user can see 4 fields and only one submit button that can be 
> used to insert new values of these fields. Only the fields that have been 
> filled by the user must be inserted (blank fields must not have new 
> insertions). This is somewhat similar to what is given in the manual (
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#One-form-for-multiple-tables)
>  
> however, I don't have a common foreign-key (like the client-id of the given 
> example) and hence would like to know how to do such a thing, if at all 
> possible.
>
> models/db.py
> ###
> # Set the Application Period Deadline.#
> ###
> db.define_table(
> 'AppDeadline',
> Field('start','datetime',required=True, label='Start Time'),
> Field('end','datetime',required=True, label='End Time')
> )
>
>
> ###
> # Set the Nomination Period Deadline.#
> ###
> db.define_table(
> 'NomDeadline',
> Field('start','datetime',required=True, label='Start Time'),
> Field('end','datetime',required=True, label='End Time')
> )
>
> What I want is *something like,* 
>
> form = SQLFORM.factory(db.AppDeadline, db.NomDeadline)
> if form.process().accepted:
> if form.vars.appTime: #To check if application-fields have been 
> updated
> response.flash = 'Application Period Set : '+str(form.vars.start)+' 
> to '+str(form.vars.end)
> db.UserLogs.insert(activity='Application Period Set : '+str(form.
> vars.start)+' to '+str(form.vars.end))
> if form.vars.nomTime: #To check if nomination-fields have been updated
> response.flash = 'Nomination Period Set : '+str(form.vars.start)+' 
> to '+str(form.vars.end)
> db.UserLogs.insert(activity='Nomination Period Set : '+str(form.
> vars.start)+' to '+str(form.vars.end))
> elif form.errors:
> response.flash = 'Form has error(s)!'
>
>
> Regards,
> Mohit
>

-- 
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: Which free email service works fine with web2py?

2016-05-23 Thread 黄祥
not sure what do you need, do you mean the smtp service? i think you could 
use your isp smtp or smtp from your domain hosting. i've seen in the other 
post that gmail is fine if you don't activate two factor authentification 
in gmail (lionel point it up, if i'm not mistake)

best regards,
stifan

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


Re: [web2py] Re: Handling (2006, 'MySQL server has gone away') from Scheduler, pythonanywhere

2016-05-23 Thread Andre Kozaczka
Hi Ian - I'm running into the same issue as you. Do you know the root cause 
of the error? Did you end up creating your own scheduling handler?

-Andre

On Thursday, February 5, 2015 at 5:55:04 AM UTC-5, Ian Ryder wrote:

> Think it is pretty similar to this - we have 3 databases open. Seems to 
> only happen when a big process / query runs.
>
> More worrying now is that I'm getting situations where a process starts 
> and just disappears into the ether - no timeout, no fail, no error message. 
> Just starts and is never seen again...not even sure where to start with 
> that.
>
> I think I'm going to roll my own scheduling handler, I don't need anything 
> too complicated right now - loop away, look for a new request, run it in 
> isolation and record everything that happens along the way. Might be back 
> if that doesn't work out :)
>
> On Tuesday, February 3, 2015 at 3:07:40 PM UTC+11, Kiran Subbaraman wrote:
>>
>> Looks similar to this open-issue: 
>> https://github.com/web2py/web2py/issues/733
>>
>> 
>> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>>
>> On Tue, 03-02-2015 2:47 AM, Niphlod wrote:
>>
>> uhm. does pythonanywhere even support a running process outside the web 
>> one ?
>>
>> BTW: all "kinky" calls to the db are fail-safed in the scheduler (see 
>> "wrapped_*" functions), to alleviate locking (albeit primarely for sqlite). 
>> This has the added benefit of making the scheduler more resilient against 
>> blocking, but this "has gone away" sounds like some problems with the 
>> underlying connectionpool
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>

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


Re: [web2py] Re: Handling (2006, 'MySQL server has gone away') from Scheduler, pythonanywhere

2016-05-23 Thread Ian Ryder
Hi Andre, yes, I did indeed write my own - there's a lot in the built in 
one we just didn't need and we really needed to be able to see everything 
that was happening.

I don't see the issue too often now and we have processes that have run for 
a month without issue...from memory I think the main thing is commit the 
database before calling a long running process (db.commit()).

On Monday, 23 May 2016 16:05:36 UTC+2, Andre Kozaczka wrote:
>
> Hi Ian - I'm running into the same issue as you. Do you know the root 
> cause of the error? Did you end up creating your own scheduling handler?
>
> -Andre
>
> On Thursday, February 5, 2015 at 5:55:04 AM UTC-5, Ian Ryder wrote:
>
>> Think it is pretty similar to this - we have 3 databases open. Seems to 
>> only happen when a big process / query runs.
>>
>> More worrying now is that I'm getting situations where a process starts 
>> and just disappears into the ether - no timeout, no fail, no error message. 
>> Just starts and is never seen again...not even sure where to start with 
>> that.
>>
>> I think I'm going to roll my own scheduling handler, I don't need 
>> anything too complicated right now - loop away, look for a new request, run 
>> it in isolation and record everything that happens along the way. Might be 
>> back if that doesn't work out :)
>>
>> On Tuesday, February 3, 2015 at 3:07:40 PM UTC+11, Kiran Subbaraman wrote:
>>>
>>> Looks similar to this open-issue: 
>>> https://github.com/web2py/web2py/issues/733
>>>
>>> 
>>> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>>>
>>> On Tue, 03-02-2015 2:47 AM, Niphlod wrote:
>>>
>>> uhm. does pythonanywhere even support a running process outside the web 
>>> one ?
>>>
>>> BTW: all "kinky" calls to the db are fail-safed in the scheduler (see 
>>> "wrapped_*" functions), to alleviate locking (albeit primarely for sqlite). 
>>> This has the added benefit of making the scheduler more resilient 
>>> against blocking, but this "has gone away" sounds like some problems with 
>>> the underlying connectionpool
>>> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to web2py+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>

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


Re: [web2py] Re: Handling (2006, 'MySQL server has gone away') from Scheduler, pythonanywhere

2016-05-23 Thread Andre Kozaczka
Thanks for the quick response! You still using pythonanywhere?


On Monday, May 23, 2016 at 10:12:49 AM UTC-4, Ian Ryder wrote:

> Hi Andre, yes, I did indeed write my own - there's a lot in the built in 
> one we just didn't need and we really needed to be able to see everything 
> that was happening.
>
> I don't see the issue too often now and we have processes that have run 
> for a month without issue...from memory I think the main thing is commit 
> the database before calling a long running process (db.commit()).
>
> On Monday, 23 May 2016 16:05:36 UTC+2, Andre Kozaczka wrote:
>>
>> Hi Ian - I'm running into the same issue as you. Do you know the root 
>> cause of the error? Did you end up creating your own scheduling handler?
>>
>> -Andre
>>
>> On Thursday, February 5, 2015 at 5:55:04 AM UTC-5, Ian Ryder wrote:
>>
>>> Think it is pretty similar to this - we have 3 databases open. Seems to 
>>> only happen when a big process / query runs.
>>>
>>> More worrying now is that I'm getting situations where a process starts 
>>> and just disappears into the ether - no timeout, no fail, no error message. 
>>> Just starts and is never seen again...not even sure where to start with 
>>> that.
>>>
>>> I think I'm going to roll my own scheduling handler, I don't need 
>>> anything too complicated right now - loop away, look for a new request, run 
>>> it in isolation and record everything that happens along the way. Might be 
>>> back if that doesn't work out :)
>>>
>>> On Tuesday, February 3, 2015 at 3:07:40 PM UTC+11, Kiran Subbaraman 
>>> wrote:

 Looks similar to this open-issue: 
 https://github.com/web2py/web2py/issues/733

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

 On Tue, 03-02-2015 2:47 AM, Niphlod wrote:

 uhm. does pythonanywhere even support a running process outside the web 
 one ?

 BTW: all "kinky" calls to the db are fail-safed in the scheduler (see 
 "wrapped_*" functions), to alleviate locking (albeit primarely for 
 sqlite). 
 This has the added benefit of making the scheduler more resilient 
 against blocking, but this "has gone away" sounds like some problems with 
 the underlying connectionpool
 -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to the Google 
 Groups "web2py-users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




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


Re: [web2py] Re: Handling (2006, 'MySQL server has gone away') from Scheduler, pythonanywhere

2016-05-23 Thread Ian Ryder
No worries!

For our app, no - the main thing being the consoles disappearing every day 
or two...no good for running background services. We now have our own AWS 
servers, took a bit of effort but it's a thing of beauty once it's all in 
place :) Don't get me wrong, PythonAnywhere is fantastic - so easy to get 
going, just not enough control for our full requirements.

On Monday, 23 May 2016 16:40:17 UTC+2, Andre Kozaczka wrote:
>
> Thanks for the quick response! You still using pythonanywhere?
>
>
> On Monday, May 23, 2016 at 10:12:49 AM UTC-4, Ian Ryder wrote:
>
>> Hi Andre, yes, I did indeed write my own - there's a lot in the built in 
>> one we just didn't need and we really needed to be able to see everything 
>> that was happening.
>>
>> I don't see the issue too often now and we have processes that have run 
>> for a month without issue...from memory I think the main thing is commit 
>> the database before calling a long running process (db.commit()).
>>
>> On Monday, 23 May 2016 16:05:36 UTC+2, Andre Kozaczka wrote:
>>>
>>> Hi Ian - I'm running into the same issue as you. Do you know the root 
>>> cause of the error? Did you end up creating your own scheduling handler?
>>>
>>> -Andre
>>>
>>> On Thursday, February 5, 2015 at 5:55:04 AM UTC-5, Ian Ryder wrote:
>>>
 Think it is pretty similar to this - we have 3 databases open. Seems to 
 only happen when a big process / query runs.

 More worrying now is that I'm getting situations where a process starts 
 and just disappears into the ether - no timeout, no fail, no error 
 message. 
 Just starts and is never seen again...not even sure where to start with 
 that.

 I think I'm going to roll my own scheduling handler, I don't need 
 anything too complicated right now - loop away, look for a new request, 
 run 
 it in isolation and record everything that happens along the way. Might be 
 back if that doesn't work out :)

 On Tuesday, February 3, 2015 at 3:07:40 PM UTC+11, Kiran Subbaraman 
 wrote:
>
> Looks similar to this open-issue: 
> https://github.com/web2py/web2py/issues/733
>
> 
> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>
> On Tue, 03-02-2015 2:47 AM, Niphlod wrote:
>
> uhm. does pythonanywhere even support a running process outside the 
> web one ?
>
> BTW: all "kinky" calls to the db are fail-safed in the scheduler (see 
> "wrapped_*" functions), to alleviate locking (albeit primarely for 
> sqlite). 
> This has the added benefit of making the scheduler more resilient 
> against blocking, but this "has gone away" sounds like some problems with 
> the underlying connectionpool
> -- 
> 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.


[web2py] Re: Which free email service works fine with web2py?

2016-05-23 Thread Pierre
mailgun works fine. it's free under a certain quota
https://www.mailgun.com/

-- 
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: No module named appname.modules.funtions

2016-05-23 Thread BlueShadow
there were a couple files assigned to root^^ chown to www-data and it 
worked^^

On Sunday, May 22, 2016 at 2:28:38 PM UTC+2, BlueShadow wrote:
>
> Hi,
> Something is very wrong with my web2py. I finally got the newest verion 
> (2.14.6  nginx/1.4.6, Python 2.7.6 Ubuntu 16.04) on my production server. 
> and the welcome app is running fine. when I want to use my application it 
> creates a ticket for basically every inport:
> Movie_Alarm.modules.plugin_multiselect_widget
> I uncommented the multiselect plugin and I got the next:
> No module named appname.modules.func
> ...
> and so on the files are in web2py/applications/appname/modules or plugins 
> respectively. I can open them with the webinterface. So I got no clue whats 
> going on.
> thanks for your help and suggestions
>

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


[web2py] routes.py problems

2016-05-23 Thread BlueShadow
I reinstalled pretty much everything on my Server new OS newest web2py ... 
and got my application back and running :-) but web2py uses still the 
default routes.py.
when I copied my old routes.py to the web2py root I got an internal server 
error. I thought well lets use the example file copied it to root and 
renamed it to routes.py same thing. when I remove the routes.py it woks 
(welcome app at domain and app at domain/app)

any suggestions or help is very welcome :) 

-- 
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: routes.py problems

2016-05-23 Thread Jim S
Can you post the routes.py that is not working?

-Jim


On Monday, May 23, 2016 at 11:20:41 AM UTC-5, BlueShadow wrote:
>
> I reinstalled pretty much everything on my Server new OS newest web2py ... 
> and got my application back and running :-) but web2py uses still the 
> default routes.py.
> when I copied my old routes.py to the web2py root I got an internal server 
> error. I thought well lets use the example file copied it to root and 
> renamed it to routes.py same thing. when I remove the routes.py it woks 
> (welcome app at domain and app at domain/app)
>
> any suggestions or help is very welcome :) 
>

-- 
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: routes.py problems

2016-05-23 Thread BlueShadow
#!/usr/bin/python
# -*- coding: utf-8 -*-


routers = dict(
  BASE  = dict(
  domains = {
  'domain.com' : 'App',
  'www.domain.com' : 'App',
  '111.111.111.111/test' : 'test',

  }
  ),
  App = dict(
  root_static=['BingSiteAuth.xml','googlea0df30fe6baf4df4.html',
'f8d6b8.html','favicon.ico','Favicon.ico', 'robots.txt','humans.txt']
  )
)


routes_onerror = [
('App/*', '/App/default/error_site')
]

logging = 'warning'




On Monday, May 23, 2016 at 6:20:41 PM UTC+2, BlueShadow wrote:
>
> I reinstalled pretty much everything on my Server new OS newest web2py ... 
> and got my application back and running :-) but web2py uses still the 
> default routes.py.
> when I copied my old routes.py to the web2py root I got an internal server 
> error. I thought well lets use the example file copied it to root and 
> renamed it to routes.py same thing. when I remove the routes.py it woks 
> (welcome app at domain and app at domain/app)
>
> any suggestions or help is very welcome :) 
>

-- 
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: routes.py problems

2016-05-23 Thread Jim Steil
And, what is the error?

On Mon, May 23, 2016 at 11:33 AM, BlueShadow  wrote:

> #!/usr/bin/python
> # -*- coding: utf-8 -*-
>
>
> routers = dict(
>   BASE  = dict(
>   domains = {
>   'domain.com' : 'App',
>   'www.domain.com' : 'App',
>   '111.111.111.111/test' : 'test',
>
>   }
>   ),
>   App = dict(
>   root_static=['BingSiteAuth.xml','googlea0df30fe6baf4df4.html',
> 'f8d6b8.html','favicon.ico','Favicon.ico', 'robots.txt','humans.txt']
>   )
> )
>
>
> routes_onerror = [
> ('App/*', '/App/default/error_site')
> ]
>
> logging = 'warning'
>
>
>
>
> On Monday, May 23, 2016 at 6:20:41 PM UTC+2, BlueShadow wrote:
>>
>> I reinstalled pretty much everything on my Server new OS newest web2py
>> ... and got my application back and running :-) but web2py uses still the
>> default routes.py.
>> when I copied my old routes.py to the web2py root I got an internal
>> server error. I thought well lets use the example file copied it to root
>> and renamed it to routes.py same thing. when I remove the routes.py it woks
>> (welcome app at domain and app at domain/app)
>>
>> any suggestions or help is very welcome :)
>>
> --
> 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/PDw01ZLpUqY/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.


Re: [web2py] Re: routes.py problems

2016-05-23 Thread Kevin Bethke
like I said an internal server error so I guess the error is before web2py?

On Mon, May 23, 2016 at 6:45 PM, Jim Steil  wrote:

> And, what is the error?
>
> On Mon, May 23, 2016 at 11:33 AM, BlueShadow 
> wrote:
>
>> #!/usr/bin/python
>> # -*- coding: utf-8 -*-
>>
>>
>> routers = dict(
>>   BASE  = dict(
>>   domains = {
>>   'domain.com' : 'App',
>>   'www.domain.com' : 'App',
>>   '111.111.111.111/test' : 'test',
>>
>>   }
>>   ),
>>   App = dict(
>>   root_static=['BingSiteAuth.xml','googlea0df30fe6baf4df4.html',
>> 'f8d6b8.html','favicon.ico','Favicon.ico', 'robots.txt','humans.txt']
>>   )
>> )
>>
>>
>> routes_onerror = [
>> ('App/*', '/App/default/error_site')
>> ]
>>
>> logging = 'warning'
>>
>>
>>
>>
>> On Monday, May 23, 2016 at 6:20:41 PM UTC+2, BlueShadow wrote:
>>>
>>> I reinstalled pretty much everything on my Server new OS newest web2py
>>> ... and got my application back and running :-) but web2py uses still the
>>> default routes.py.
>>> when I copied my old routes.py to the web2py root I got an internal
>>> server error. I thought well lets use the example file copied it to root
>>> and renamed it to routes.py same thing. when I remove the routes.py it woks
>>> (welcome app at domain and app at domain/app)
>>>
>>> any suggestions or help is very welcome :)
>>>
>> --
>> 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/PDw01ZLpUqY/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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/PDw01ZLpUqY/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.


Re: [web2py] Re: routes.py problems

2016-05-23 Thread Jim Steil
What webserver, and what URL are you accessing?

On Mon, May 23, 2016 at 11:45 AM, Jim Steil  wrote:

> And, what is the error?
>
> On Mon, May 23, 2016 at 11:33 AM, BlueShadow 
> wrote:
>
>> #!/usr/bin/python
>> # -*- coding: utf-8 -*-
>>
>>
>> routers = dict(
>>   BASE  = dict(
>>   domains = {
>>   'domain.com' : 'App',
>>   'www.domain.com' : 'App',
>>   '111.111.111.111/test' : 'test',
>>
>>   }
>>   ),
>>   App = dict(
>>   root_static=['BingSiteAuth.xml','googlea0df30fe6baf4df4.html',
>> 'f8d6b8.html','favicon.ico','Favicon.ico', 'robots.txt','humans.txt']
>>   )
>> )
>>
>>
>> routes_onerror = [
>> ('App/*', '/App/default/error_site')
>> ]
>>
>> logging = 'warning'
>>
>>
>>
>>
>> On Monday, May 23, 2016 at 6:20:41 PM UTC+2, BlueShadow wrote:
>>>
>>> I reinstalled pretty much everything on my Server new OS newest web2py
>>> ... and got my application back and running :-) but web2py uses still the
>>> default routes.py.
>>> when I copied my old routes.py to the web2py root I got an internal
>>> server error. I thought well lets use the example file copied it to root
>>> and renamed it to routes.py same thing. when I remove the routes.py it woks
>>> (welcome app at domain and app at domain/app)
>>>
>>> any suggestions or help is very welcome :)
>>>
>> --
>> 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/PDw01ZLpUqY/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.


Re: [web2py] Re: routes.py problems

2016-05-23 Thread Jim Steil
What OS?

On Mon, May 23, 2016 at 11:52 AM, Jim Steil  wrote:

> What webserver, and what URL are you accessing?
>
> On Mon, May 23, 2016 at 11:45 AM, Jim Steil  wrote:
>
>> And, what is the error?
>>
>> On Mon, May 23, 2016 at 11:33 AM, BlueShadow 
>> wrote:
>>
>>> #!/usr/bin/python
>>> # -*- coding: utf-8 -*-
>>>
>>>
>>> routers = dict(
>>>   BASE  = dict(
>>>   domains = {
>>>   'domain.com' : 'App',
>>>   'www.domain.com' : 'App',
>>>   '111.111.111.111/test' : 'test',
>>>
>>>   }
>>>   ),
>>>   App = dict(
>>>   root_static=['BingSiteAuth.xml','googlea0df30fe6baf4df4.html',
>>> 'f8d6b8.html','favicon.ico','Favicon.ico', 'robots.txt','humans.txt']
>>>   )
>>> )
>>>
>>>
>>> routes_onerror = [
>>> ('App/*', '/App/default/error_site')
>>> ]
>>>
>>> logging = 'warning'
>>>
>>>
>>>
>>>
>>> On Monday, May 23, 2016 at 6:20:41 PM UTC+2, BlueShadow wrote:

 I reinstalled pretty much everything on my Server new OS newest web2py
 ... and got my application back and running :-) but web2py uses still the
 default routes.py.
 when I copied my old routes.py to the web2py root I got an internal
 server error. I thought well lets use the example file copied it to root
 and renamed it to routes.py same thing. when I remove the routes.py it woks
 (welcome app at domain and app at domain/app)

 any suggestions or help is very welcome :)

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


Re: [web2py] Re: routes.py problems

2016-05-23 Thread Kevin Bethke
Os: ubuntu 16.04. Webserver: Nginx url: www.movie-alarm.de
Am 23.05.2016 18:52 schrieb "Jim Steil" :

> What OS?
>
> On Mon, May 23, 2016 at 11:52 AM, Jim Steil  wrote:
>
>> What webserver, and what URL are you accessing?
>>
>> On Mon, May 23, 2016 at 11:45 AM, Jim Steil  wrote:
>>
>>> And, what is the error?
>>>
>>> On Mon, May 23, 2016 at 11:33 AM, BlueShadow 
>>> wrote:
>>>
 #!/usr/bin/python
 # -*- coding: utf-8 -*-


 routers = dict(
   BASE  = dict(
   domains = {
   'domain.com' : 'App',
   'www.domain.com' : 'App',
   '111.111.111.111/test' : 'test',

   }
   ),
   App = dict(
   root_static=['BingSiteAuth.xml','googlea0df30fe6baf4df4.html',
 'f8d6b8.html','favicon.ico','Favicon.ico', 'robots.txt','humans.txt']
   )
 )


 routes_onerror = [
 ('App/*', '/App/default/error_site')
 ]

 logging = 'warning'




 On Monday, May 23, 2016 at 6:20:41 PM UTC+2, BlueShadow wrote:
>
> I reinstalled pretty much everything on my Server new OS newest web2py
> ... and got my application back and running :-) but web2py uses still the
> default routes.py.
> when I copied my old routes.py to the web2py root I got an internal
> server error. I thought well lets use the example file copied it to root
> and renamed it to routes.py same thing. when I remove the routes.py it 
> woks
> (welcome app at domain and app at domain/app)
>
> any suggestions or help is very welcome :)
>
 --
 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/PDw01ZLpUqY/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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/PDw01ZLpUqY/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.


Re: [web2py] Re: routes.py problems

2016-05-23 Thread Jim S
Have you looked at /var/log/nginx/error.log?

-Jim

On Monday, May 23, 2016 at 11:54:31 AM UTC-5, BlueShadow wrote:
>
> Os: ubuntu 16.04. Webserver: Nginx url: www.movie-alarm.de
> Am 23.05.2016 18:52 schrieb "Jim Steil" >:
>
>> What OS?
>>
>> On Mon, May 23, 2016 at 11:52 AM, Jim Steil > > wrote:
>>
>>> What webserver, and what URL are you accessing?
>>>
>>> On Mon, May 23, 2016 at 11:45 AM, Jim Steil >> > wrote:
>>>
 And, what is the error?

 On Mon, May 23, 2016 at 11:33 AM, BlueShadow >>> > wrote:

> #!/usr/bin/python
> # -*- coding: utf-8 -*-
>
>
> routers = dict(
>   BASE  = dict(
>   domains = {
>   'domain.com' : 'App',
>   'www.domain.com' : 'App',
>   '111.111.111.111/test' : 'test',
>
>   }
>   ),
>   App = dict(
>   root_static=['BingSiteAuth.xml','googlea0df30fe6baf4df4.html',
> 'f8d6b8.html','favicon.ico','Favicon.ico', 'robots.txt','humans.txt']
>   )
> )
>
>
> routes_onerror = [
> ('App/*', '/App/default/error_site')
> ]
>
> logging = 'warning'
>
>
>
>
> On Monday, May 23, 2016 at 6:20:41 PM UTC+2, BlueShadow wrote:
>>
>> I reinstalled pretty much everything on my Server new OS newest 
>> web2py ... and got my application back and running :-) but web2py uses 
>> still the default routes.py.
>> when I copied my old routes.py to the web2py root I got an internal 
>> server error. I thought well lets use the example file copied it to root 
>> and renamed it to routes.py same thing. when I remove the routes.py it 
>> woks 
>> (welcome app at domain and app at domain/app)
>>
>> any suggestions or help is very welcome :) 
>>
> -- 
> 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/PDw01ZLpUqY/unsubscribe.
> To unsubscribe from this group and all its topics, 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/PDw01ZLpUqY/unsubscribe.
>> To unsubscribe from this group and all its topics, 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.


[web2py] Re: COLLATE for sorting in SQLite (especially in SQLFORM.grid)

2016-05-23 Thread Mirek Zvolský
So what for problem I have had earlier? I don't know.
I have tested today and it works.
Made I some mistake? Or something has changed in newer Web2py versions?
Great ! Great ! Proper sorting in SQLite smartgrid now works.

I do this in model (to be sure it run always, which is most important if I 
decide make experiments with SQLite indexes with collating - however what I 
describe here works without indexes):
import platform
if 'windows' in platform.system().lower():
locale.setlocale(locale.LC_ALL, 'Czech_Czech republic.1250')  # 
Microsoft's stupidities
else:
locale.setlocale(locale.LC_ALL, 'cs_CZ.utf8')
db._adapter.connection.create_collation("czech", locale.strcoll)   # 
for sqlite only !

and in smartgrid all next posibilities work:
orderby={'places': 'places.place collate `czech`'},
orderby={'places': place collate `czech`'},
orderby={'places': place collate czech'},

It is nice in pydal select() too. However in pydal select() we could fix 
the order later at python level like so:
rows.sort(key=lambda row: (locale.strxfrm(row,place), row.cnt))

But inside the smartgrid we could not correct it, so it is really nice that 
it works.

The other possibility is
- create tables via localhost:8000/application/appadmin
- drop table places (in sqlite manager)
- create table places . place char(255) collate `czech`
This works too.
However this in conflict with automatic migration - next migration will 
break the collating.







Dne středa 20. května 2015 17:34:58 UTC+2 Mirek Zvolský napsal(a):
>
> Using SQLite I want have proper alphabetical sorting for the users 
> language at the database level (from ORDER BY).
>
> My question is:
>
> 1) is there a way to get this behaviour ?
>
> 2) if not, can it be achieved with code bellow without modifying the 
> Web2py framework ?
>
> 3) if not (if it will require Web2py framework change), what is the best 
> way how to implement this (or..can it implement somebody from core 
> developers) ?
>
>
> I have tested that collating/compare function can be set for SQLite so:
> import locale
> locale.setlocale(locale.LC_ALL, 'cs_CZ.utf8')
> db = DAL('sqlite://db.sqlite')
> db._adapter.connection.create_collation("lexical", locale.strcoll)
>
> and then the raw sql command:
> db.executesql('SELECT nick FROM auth_user ORDER BY nick COLLATE lexical;')
> return records in correct alphabetical order for given language.
>
> So, so far we need no change in the framework.
>
> In SQLFORM.Grid works
> orderby=db.auth_user.nick
> and
> orderby='auth_user.nick'
> too.
>
> But with hack like
> orderby='auth_user.nick COLLATE lexical'
> I was not successfull.
>
>

-- 
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: scheduler use python modules

2016-05-23 Thread Dave S
On Saturday, May 21, 2016 at 1:28:20 AM UTC-7, 黄祥 wrote:
>
> is scheduler can use python modules?
>

Certainly.  In one of my scheduled tasks, I import os.path, datetime, sys, 
pysftp, and time.

And this is done in a module.  The  "outer" procedure in the model imports 
datetime, the module, and current (from gluon).

/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: scheduler use python modules

2016-05-23 Thread Dave S


On Saturday, May 21, 2016 at 12:08:14 PM UTC-7, Anthony wrote:
>
> Just to be clear, the traceback is from the view? 
>
 
It looks like the error involves a* mail template* that happens to be in a 
subdirectory of application/views.

I can't read the traceback elsethread, not knowing enough about the 
rendering functions.

/dps

Can you show the whole traceback and the line that triggers it?
>
> On Saturday, May 21, 2016 at 4:28:20 AM UTC-4, 黄祥 wrote:
>>
>> is scheduler can use python modules?
>> e.g.
>> *[...]* 
>>
> solution work in views must import locale
>> *e.g. in views/templates/mail/investor.html*
>>
>  

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


[web2py] Re: No module named appname.modules.funtions

2016-05-23 Thread Dave S
On Monday, May 23, 2016 at 9:14:57 AM UTC-7, BlueShadow wrote:
>
> there were a couple files assigned to root^^ chown to www-data and it 
> worked^^
>
>
Always good to hear about a simple fix!

/dps

 

> On Sunday, May 22, 2016 at 2:28:38 PM UTC+2, BlueShadow wrote:
>>
>> Hi,
>> Something is very wrong with my web2py. I finally got the newest verion 
>> (2.14.6  nginx/1.4.6, Python 2.7.6 Ubuntu 16.04) on my production 
>> server. and the welcome app is running fine. when I want to use my 
>> application it creates a ticket for basically every inport:
>> Movie_Alarm.modules.plugin_multiselect_widget
>> I uncommented the multiselect plugin and I got the next:
>> No module named appname.modules.func
>> ...
>> and so on the files are in web2py/applications/appname/modules or plugins 
>> respectively. I can open them with the webinterface. So I got no clue whats 
>> going on.
>> thanks for your help and suggestions
>>
>

-- 
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: routes.py problems

2016-05-23 Thread BlueShadow

It seems to work now my routes.py had no default application. I still need 
to figure out how to route the other sites but new day new luck. thanks Jim

-- 
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: scheduler use python modules

2016-05-23 Thread 黄祥
in web2py book, i think we can put template using response.render in any 
place in views.
*ref:*
http://web2py.com/books/default/chapter/29/08/emails-and-sms?search=response.render#Using-the-template-system-to-generate-messages

*the evidence fact i got :*
- mail() with response.render() that executed in models (after_insert and 
after_update callback) can work with python module (e.g. locale) but not in 
scheduler (must redefine it)
- same template work fine (without redefine import locale) in another 
controller (reports.py just to generate report in web browser not sending 
email like the one in my scheduler)
- in my mail template there is another python module datetime, but work 
fine without not redefine it 

*my conclusion :*
- python locale module when used by scheduler must redefine it again in 
views

please correct me if i'm wrong about my conclusion.

thanks and best regards,
stifan

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


[web2py] Re: scheduler use python modules

2016-05-23 Thread Dave S
On Monday, May 23, 2016 at 3:01:14 PM UTC-7, 黄祥 wrote:
 

> *my conclusion :*
> - python locale module when used by scheduler must redefine it again in 
> views
>

Does it work to import locale in the module instead of in the view?

Modules do not get the complete global environment from the model or 
controller that calls them
(per request, or per scheduler task, etc), which is why I import current, 
per the book.

/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] Is auth.settings.login_onfail a documented callback?

2016-05-23 Thread Antonio Salazar

I'm implementing a failed login cooldown timer usin: 
auth.settings.login_onfail = lambda: ...

Searching here it seems as the recommended approach, but the callback is 
not mentioned in the manual. Is it a documented feature?

P.S.
The manual only mentions these login callbacks:

auth.settings.login_onvalidation = []
auth.settings.login_onaccept = []



-- 
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: scheduler use python modules

2016-05-23 Thread 黄祥

>
> Does it work to import locale in the module instead of in the view?
>

import python module doesn't work in web2py modules, so it must redefine 
again (e.g. locale, datetime)
 

>
> Modules do not get the complete global environment from the model or 
> controller that calls them
> (per request, or per scheduler task, etc), which is why I import current, 
> per the book.
>
> /dps
>  
>

thank you the hint.

best regards,
stifan 

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


[web2py] Re: Is auth.settings.login_onfail a documented callback?

2016-05-23 Thread Anthony
As you have observed, it is not documented. If you're asking whether it is 
supported, yes -- I think the lack of documentation is just an oversight.

Anthony

On Monday, May 23, 2016 at 7:40:58 PM UTC-4, Antonio Salazar wrote:
>
>
> I'm implementing a failed login cooldown timer using: 
> auth.settings.login_onfail = lambda: ...
>
> Searching here it seems as the recommended approach, but the callback is 
> not mentioned in the manual. Is it a documented feature?
>
> P.S.
> The manual only mentions these login callbacks:
>
> auth.settings.login_onvalidation = []
> auth.settings.login_onaccept = []
>
>
>
>

-- 
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: scheduler use python modules

2016-05-23 Thread Dave S


On Monday, May 23, 2016 at 5:05:59 PM UTC-7, 黄祥 wrote:
>
> Does it work to import locale in the module instead of in the view?
>>
>
> import python module doesn't work in web2py modules, so it must redefine 
> again (e.g. locale, datetime)
>

Importing datetime in a module called by a scheduler task works for me.  I 
have not need to use locale.
 

> Modules do not get the complete global environment from the model or 
>> controller that calls them
>> (per request, or per scheduler task, etc), which is why I import current, 
>> per the book.
>>
>> /dps
>>  
>>
>
> thank you the hint.
>
> best regards,
> stifan 
>

I've taken hints from you on occasion ... so here's looking at you, kid.

/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: Is auth.settings.login_onfail a documented callback?

2016-05-23 Thread 黄祥
perhaps an example can speak thousand words :
e.g.
def login_onfail(form):
email = request.vars.email
row = db((db.auth_user.email == email ) ).select().first()
if row is not None:
db.auth_event.insert(time_stamp = request.now, 
client_ip = request.client, 
user_id = row.id, 
origin = '%s/%s' % (request.controller, 
request.function), 
description = '%s login failed' % (row.email) )

auth.settings.login_onfail.append(login_onfail)

best regards,
stifan

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