[web2py] Re: Processing taking a long time in web2py?

2016-11-17 Thread Simon Andersson
I'm asking why opening a process in a python script takes much less time than opening the same python code/process in a web2py application. Also yes I will consider your second point but I think I will hide it behind authentication On Thursday, 17 November 2016 22:53:50 UTC, Niphlod wrote: > >

[web2py] Re: Text area input field DAL question

2016-11-17 Thread 黄祥
pardon, not sure, i got what do you mean, here is the code of the message store (db.mail_queue and the full templates views) *models/db.py* db.define_table('mail_queue', Field('mail_to', 'list:string'), Field('subject'), Field('messages', 'text'), Field('status'), format = lambda r: '%s - %s

[web2py] Re: web2py as Grafana endpoint

2016-11-17 Thread Dave S
On Thursday, November 17, 2016 at 2:38:57 PM UTC-8, Niphlod wrote: > > if the request comes in either as a POST or as a PUT it has a body (since > all examples report a faily nested query structure, I'd say it's the case > vs a simple querystring in a GET) > > If the body carries the correct

[web2py] Re: What a good web2py application architecture looks like?

2016-11-17 Thread mfarees . knysys
*@*Val K Thanks but I'm not using stored procedures. I have DAL queries in which the where clause is manipulated via method parameters. So the code would look something like this, def get_user(id=None, first_name=None): return db((db.auth_user.id == id) & (db.auth_user.first_name ==

[web2py] Re: What a good web2py application architecture looks like?

2016-11-17 Thread mfarees . knysys
@Leonel Câmara Thanks for your input on this. Perhaps I didn't explain the structure very well. I do have controllers and they have the same as some of the BOs. But not every BO has its own controller. There are some BOs that only communicate with BOs and not with controllers. Also, the

[web2py] Re: What a good web2py application architecture looks like?

2016-11-17 Thread mfarees . knysys
Thanks for your input on this. Perhaps I didn't explain the structure very well. I do have controllers and they have the same as some of the BOs. But not every BO has its own controller. There are some BOs that only communicate with BOs and not with controllers. Also, the controllers have the

[web2py] Re: What a good web2py application architecture looks like?

2016-11-17 Thread mfarees . knysys
Thanks for your input on this. Perhaps I didn't explain the structure very well. I do have controllers and they have the same as some of the BOs. But not every BO has its own controller. There are some BOs that only communicate with BOs and not with controllers. Also, the controllers have the

[web2py] Re: Text area input field DAL question

2016-11-17 Thread Anthony
What does this have to do with escaping HTML content written into the view? The problem area appears to be some static content that is part of the view itself, not the row_test data. Anthony On Thursday, November 17, 2016 at 4:57:15 PM UTC-5, 黄祥 wrote: > > here is the code : > *models/db.py*

[web2py] 50x performance improvement for web2py in TechEmpower Web Framework Benchmarks

2016-11-17 Thread Anthony
TechEmpower just released Round 13 of its Web Framework Benchmarks. In previous rounds, web2py did very poorly because the original app that was submitted was using some inefficient code and was deployed with the development server rather than a production server. Here is a link to results

[web2py] Re: Processing taking a long time in web2py?

2016-11-17 Thread Niphlod
well... you're asking why opening a process in python rather than doing it directly takes more time. no wonders there: of course it takes more time! Especially if your process writes lots to stdout/stderr that python needs to collect. BTW: never ever ever run ANY external process from the

[web2py] Re: Script timed out before returning headers for apache server when scheduler task is running

2016-11-17 Thread Niphlod
are you running sqlite ? if so, AT LEAST run the scheduler on a different sqlite database, as sqlite doesn't really withstand lots of concurrent writes (that the scheduler does). if your web app shares the same sqlite db as the scheduler, it gets blocked whenever the scheduler writes something

[web2py] Re: what is in the cache ?

2016-11-17 Thread Niphlod
read CAREFULLY http://web2py.com/books/default/chapter/29/04/the-core#cache . Unfortunately (?) web2py's cache isn't "the usual" cache object, as it's designed to store indefinitely values that do not expire automatically. Basically time_expire vouches to either fetch the stored value or to

[web2py] Re: web2py as Grafana endpoint

2016-11-17 Thread Niphlod
if the request comes in either as a POST or as a PUT it has a body (since all examples report a faily nested query structure, I'd say it's the case vs a simple querystring in a GET) If the body carries the correct content-encoding, it's automatically parsed into request.vars. You can still

[web2py] Re: Starting scheduler worker from controller

2016-11-17 Thread Niphlod
I'll say it once again: you need a scheduler to run out-of-band pieces of things (tasks) that ARE NOT embedded in the web-serving process(es). At that point you may as well process out-of-band tasks with a simple ajax call, and save yourself setting up the scheduler at all. It's strongly

[web2py] Re: Text area input field DAL question

2016-11-17 Thread 黄祥
here is the code : *models/db.py* def __after_insert_test(f, id): row_test = db(db.test.id == id).iterselect().first() mail_to = f['email'] subject = 'Data test Created' messages = response.render('templates/mail/test_1.html', dict(row_test = row_test) ) db.mail_queue.insert(mail_to =

[web2py] Re: Is web2py dying?

2016-11-17 Thread Anthony
Although official releases have slowed a bit, if you look at the commit history , you can see that development is still very active (about as active this year as in the previous few years). So, no, still very much alive. Anthony On Thursday,

[web2py] Re: Is web2py dying?

2016-11-17 Thread AlighaThor
Thanks for your quick reply. By the way, with 4 years of experience, why not start contributing too > Exactly for that reason I asked this. I'm really thinking about request being a contributor. I want do my best efforts for this awesome technology and I dont want it to die. -- Resources: -

[web2py] Re: Is web2py dying?

2016-11-17 Thread Leonel Câmara
Quite the contrary, there are some big changes being made, notably python 3 support, but many others too, they will need to be well tested and this takes time. By the way, with 4 years of experience, why not start contributing too? Your help would be very much appreciated. -- Resources:

[web2py] Is web2py dying?

2016-11-17 Thread AlighaThor
I'm a web2py developer with 4 years of experience. This framework introduced me in web development in general. I really thanks web2py for that. Now, my question is: Is web2py dying? The last release I got is from May, 2016. Is it's development, let's sayslower?? -- Resources: -

[web2py] Re: What a good web2py application architecture looks like?

2016-11-17 Thread Val K
BO seems like stored procedures that expose secure interface to DB, but if it is your aim I think it would be better and more universal to have pure stored procedures at DB-side, no? On Thursday, November 17, 2016 at 3:02:19 PM UTC+3, mfarees...@gmail.com wrote: > > Hi, > I need some help from

[web2py] Re: Starting scheduler worker from controller

2016-11-17 Thread Val K
I start scheduler as Linux daemon,it works fine. Can you do that? On Thursday, November 17, 2016 at 7:41:28 PM UTC+3, Gael Princivalle wrote: > > Hello. > > Is it possible to run a scheduler worker from a controller? > Restarting a server kill all workers. I would like to run my workers >

[web2py] Starting scheduler worker from controller

2016-11-17 Thread Gael Princivalle
Hello. Is it possible to run a scheduler worker from a controller? Restarting a server kill all workers. I would like to run my workers automatically if the last heartbeat is old. The standard way is going to ssh and running : nohup python web2py.py -K application_name & I would like to have

[web2py] Re: Sending two different emails with auth.settings.register_onaccept

2016-11-17 Thread Gael Princivalle
Thank you Stifan. Il giorno martedì 15 novembre 2016 20:50:39 UTC+1, 黄祥 ha scritto: > > perhaps you can use a function > *e.g.* > *models/db.py* > auth.settings.register_onaccept = lambda form: registration_send_mail(form) > > def registration_send_mail(form): > #1st send_mail > #2nd send_mail >

[web2py] Re: Text area input field DAL question

2016-11-17 Thread Anthony
On Wednesday, November 16, 2016 at 8:45:46 PM UTC-5, 黄祥 wrote: > > thanks for the hints, anthony, forgot about permitted_tags and > allowed_attributes arguments > how to face the html comment for that? > *e.g. :* > permitted_tags = [' > Can you show the exact input as well as your code -- I

[web2py] Re: What a good web2py application architecture looks like?

2016-11-17 Thread Leonel Câmara
It seems you're replacing controllers with business objects, which seems like unnecessary complexity for me. That's the usual style of programming in Java and very "enterprisey" but I personally hate it as the business objects tend to grow and grow and eventually you can't keep track of

Re: [web2py] Re: Graph Model (proposal to contribute)

2016-11-17 Thread JorgeH
+1 for D3 here -- 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"

[web2py] Re: Processing taking a long time in web2py?

2016-11-17 Thread Simon Andersson
def run(): import os import subprocess ex = os.path.join('/home/user', "executable") for i in range(2500): a = -5. b = 50.0 proc = subprocess.Popen([ex, str(a), str(b),],stdout=subprocess.PIPE ) (out, err) = proc.communicate()

[web2py] Re: Processing taking a long time in web2py?

2016-11-17 Thread mfarees . knysys
It would be easier to understand and solve your problem if you share the code. -- 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

[web2py] What a good web2py application architecture looks like?

2016-11-17 Thread mfarees . knysys
Hi, I need some help from experienced web2py developers and creators. I am creating a new application and would like to know what a good architecture for a web2py application looks like. Here is the architecture diagram of the past web2py projects I have worked on.

[web2py] Processing taking a long time in web2py?

2016-11-17 Thread Simon Andersson
Hi I have a function that runs an executable using subprocess. I want to run it in a loop, say 2500 times. When I run this loop in a python script it takes 5 seconds. When I run this loop on a web2py page it takes 23 seconds. When I run this loop in web2py with reading and writing to an sqlite

[web2py] For GAE developers. What's missing from a GqlQuery() call?

2016-11-17 Thread Carl Hunter Roach
I have some code running on dev_appserver and on GAE: gqldb.GqlQuery("SELECT DISTINCT acolumnn FROM atable") This used to return values from the database. The database (both locally on GAE) contain appropriate content for acolumn in atable. I think I need entries in index.yaml but