Re: [web2py] Re: How to start a thread upon starting of webserver?

2012-07-18 Thread Amit
thanks for your response, I am going to use APScheduler to schedule certain task on time interval, this scheduler has to start upon starting of application/webserver first time and should continuously run till web server stops. Basic code here in below: from apscheduler.scheduler import Scheduler

Re: [web2py] Re: How to start a thread upon starting of webserver?

2012-07-18 Thread Cédric Mayer
Can't you use in a model. cache.ram('parallel_thread_name', , None) so that you have the thread created at first connection. I don't know how to close it afterwards though. Maybe using a cron job ? Le jeudi 19 juillet 2012 05:24:03 UTC+2, Amit a écrit : > > Hi Massimo, > could you please provide

Re: [web2py] Re: How to start a thread upon starting of webserver?

2012-07-18 Thread Amit
Hi Massimo, could you please provide me the solution for this? On Wednesday, 18 July 2012 08:37:23 UTC+5:30, Amit wrote: > > for development purpose I am using Rocket but will deploy the application > to ubuntu machine where web server will be apache, so please provide me > solution for both. >

[web2py] Re: Problem running Web2py DAL (Trunk) as Standalone

2012-07-18 Thread Massimo Di Pierro
Can you check if trunk now works? On Wednesday, 18 July 2012 10:55:51 UTC-5, Phyo Arkar wrote: > > Hello Massimo and all; > > I had to update to trunk version of web2py because we having issue of > web2py DAL not closing down connection , casuing connections to queue up > and then mysql no lon

Re: [web2py] Re: Internal Error on EC2/Ubuntu

2012-07-18 Thread Jonathan Lundell
On 18 Jul 2012, at 6:33 PM, lyn2py wrote: > Thanks Jonathan. I understand it better now. > > But why does web2py run into an internal error when the owner/group > permissions is not www-data:www-data? I'm assuming/guessing that web2py needs owner permissions, not group (see my 755 example for a

Re: [web2py] Re: Internal Error on EC2/Ubuntu

2012-07-18 Thread lyn2py
Thanks Jonathan. I understand it better now. But why does web2py run into an internal error when the owner/group permissions is not www-data:www-data? On Thursday, July 19, 2012 12:11:30 AM UTC+8, Jonathan Lundell wrote: > > On 18 Jul 2012, at 9:01 AM, lyn2py wrote: > > Correction: changing the

Re: [web2py] Re: Recommendations on model file size (database tables)

2012-07-18 Thread Massimo Di Pierro
Seems like a lot. Is migrate=False. migrate=True causes file system access for every table definition and that is a bottle neck. massimo On Wednesday, 18 July 2012 20:10:35 UTC-5, pbreit wrote: > > On my Mac, each table added about 6ms. So, yeah that can add up. And > there's probably a memory

Re: [web2py] Re: Recommendations on model file size (database tables)

2012-07-18 Thread pbreit
On my Mac, each table added about 6ms. So, yeah that can add up. And there's probably a memory impact, too. --

[web2py] Re: storing e-mail messages into text fields

2012-07-18 Thread Elcimar
Yeah, like: row.myfield.replace('\n', '') I will also check if I need to take care of tabs like this as well. Thanks. Em quarta-feira, 18 de julho de 2012 21h41min04s UTC-3, Anthony escreveu: > > The line breaks should still be in the text, but if you're trying to > display the content in HT

[web2py] Re: storing e-mail messages into text fields

2012-07-18 Thread Anthony
The line breaks should still be in the text, but if you're trying to display the content in HTML, note that HTML does not display line breaks (unless you use the tag). If that's the issue, for some possible solutions, see http://stackoverflow.com/a/10584182/440323. Anthony On Wednesday, July

[web2py] storing e-mail messages into text fields

2012-07-18 Thread Elcimar
Hello I was able to retrieve messages as plain text from e-mails using poplib . This kind of data has tabs and a lot of \n, but when I store into text fields they are all lost and the text wraps around as it is a single line. What should I do to store

Re: [web2py] tenjin template engine and web2py

2012-07-18 Thread Bruno Rocha
controllers/default.py from tenjin import * from tenjin.helpers import * engine = tenjin.Engine(path=['views']) def index(): context = dict(form=SQLFORM(db.table)) return engine.render('page.pyhtml', context) That should works! http://www.kuwata-lab.com/tenjin/pytenjin-users-guide.html#

[web2py] Re: tenjin template engine and web2py

2012-07-18 Thread Francisco Costa
SpitFire (awesome name) also looks good http://code.google.com/p/spitfire/ On Thursday, July 19, 2012 12:29:57 AM UTC+1, Francisco Costa wrote: > > I was reading about python templates engines and found about *tenjin* - > http://www.kuwata-lab.com/tenjin > > Its seams that the main feature is spe

[web2py] tenjin template engine and web2py

2012-07-18 Thread Francisco Costa
I was reading about python templates engines and found about *tenjin* - http://www.kuwata-lab.com/tenjin Its seams that the main feature is speed as you can see in these benchmarks: http://www.kuwata-lab.com/tenjin/pytenjin-users-guide.html#benchmark Is it possible to use the tenjin template e

Re: [web2py] Re: Alternative to Janrain: in pure Python

2012-07-18 Thread Daniel Gonzalez
Hi, I have tried the example in this "sanction" library and it looks that the authentication using oauth2 is really easy to implement. Unfortunately the example uses BaseHTTPRequestHandler and not web2py (which is the point of this discussion, of course) I think that a first step would be, as

Re: [web2py] Re: Recommendations on model file size (database tables)

2012-07-18 Thread pbreit
Well, he said ~50 models, not 200. I realize there's superfluous processing but it might be pretty quick. I haven't seen any testing done on 50 models versus "model-less" or conditional. --

RE: [web2py] Re: Alternative to Janrain: in pure Python

2012-07-18 Thread Demian Brecht
I also confirm this. Each provider is left to determine their own API to expose resources (most follow a RESTful interface). However, the *authorization* portion is relatively consistent for each provider (relatively in that there are slight deviations, such as returned data being in either JSON o

Re: [web2py] Re: Alternative to Janrain: in pure Python

2012-07-18 Thread Michele Comitini
I confirm. Information about the user depend on the producer. It is usually a simple REST call. In theory there is not even guarantee that any user data is available to the consumer. OAuth is about giving authorization to fetch authenticated user data by a third party, i.e. the OAuth consumer. Th

[web2py] Re: KeyError on pyfpdf

2012-07-18 Thread Akash Kakkar
The Web2py-Appreport plugin belongs to Lucas de Avilla :), I most probably will be using it for one of my Project. On Thursday, 19 July 2012 01:21:10 UTC+5:30, thinkwell wrote: > > > Thanks everybody for your assistance; I'm rethinking my approach here. I'd > thought generating a PDF from html w

[web2py] Re: KeyError on pyfpdf

2012-07-18 Thread thinkwell
Thanks everybody for your assistance; I'm rethinking my approach here. I'd thought generating a PDF from html would make formatting quick & easy as well as flexible to output to a webpage. But since the PDF for printing is the primary need, perhaps using PDF cells is the way to go. Thanks, Mar

[web2py] Re: Alternative to Janrain: in pure Python

2012-07-18 Thread Massimo Di Pierro
Have you tried this? gluon/contrib/login_methods/oauth20_account.py Did you encounter any problems? The problem is that oauth2 is a strange protocol. It does not specify which information the provider must make available to the consumer. It only specifies how to request them, but not what. Ever

[web2py] Re: problem with downloading trunk using mercurial

2012-07-18 Thread Pystar
I have had issues using git from the command line to down the trunk version of web2py. I had to result to using mercurial On Wednesday, July 18, 2012 1:40:13 PM UTC+1, simon wrote: > > Tortoisehg hangs when I try to download trunk. Does not even let me exit > the program. Has worked perfectly fo

[web2py] Re: very simple question ...

2012-07-18 Thread Massimo Di Pierro
The windows nightly build it broken because we are moving to python 2.7 and are running some tests. Will let you know when it should be working again. Hopefully later today or tomorrow. On Wednesday, 18 July 2012 13:22:41 UTC-5, Ashraf Mansour wrote: > > I am trying to test my program against th

[web2py] Re: Problem running Web2py DAL (Trunk) as Standalone

2012-07-18 Thread Massimo Di Pierro
Open a ticket. there was some recent rearrangement and optimizations of the code and need more testing... On Wednesday, 18 July 2012 11:08:54 UTC-5, Phyo Arkar wrote: > > Commenting out : those lines > > version_info = open(os.path.join(global_settings.gluon_parent, 'VERSION'), > 'r') > raw_vers

Re: [web2py] Standalone DAL leaves mysql connections opened

2012-07-18 Thread Massimo Di Pierro
No. The nightly build is late. Will rebuild it soon. On Wednesday, 18 July 2012 09:31:13 UTC-5, Phyo Arkar wrote: > > Is nightly build same with mercurial/git? > i tried and db.close() do not exist there. > > On Wednesday, July 18, 2012, Phyo Arkar wrote: > >> any resolutions on this? >> >> On Wed

[web2py] Re: cPickle with protocol 2 on a storage object fails

2012-07-18 Thread Massimo Di Pierro
added. Let me know if anything breaks. On Wednesday, 18 July 2012 09:09:12 UTC-5, marius.v.niekerk wrote: > > When using pickle with protocol 2 pickling a Storage object fails > > This is caused by the __getattr__ getting called to find the > __getinitargs__ and __getnewargs__ methods. They dont

[web2py] Re: A blog app with no models - to include in /appliances

2012-07-18 Thread rdodev
Excellent example, Bruno. On Monday, July 16, 2012 10:08:19 PM UTC-4, rochacbruno wrote: > > The download is here: > > > https://github.com/downloads/rochacbruno/web2py_model_less_app/web2py.app.modellessapp.w2p > > The screenshots: > > Home (post listing) > > [image: Inline image 1] > > Show pos

[web2py] Re: Alternative to Janrain: in pure Python

2012-07-18 Thread rdodev
OAuth2 authorization for web2py would be huge. +1 On Thursday, July 5, 2012 10:42:20 AM UTC-4, Alec Taylor wrote: > > A rather good 64-line OAuth 2 client implementation for Python has been > open-sourced. > > Source-code > (announcement

[web2py] Re: very simple question ...

2012-07-18 Thread Ashraf Mansour
I am trying to test my program against the nightly build (windows). Installing web2p, I get the error *Traceback (most recent call last):* * File "web2py.py", line 16, in * *zipimport.ZipImportError: can't find module 'gluon'* * * Please, advise. Ashraf --

Re: [web2py] Re: Internal Error on EC2/Ubuntu

2012-07-18 Thread Jonathan Lundell
On 18 Jul 2012, at 9:01 AM, lyn2py wrote: > Correction: changing the permissions back to www-data ironed things out. > However, I would like user ubuntu to have access to www-data folder. > > How can I make it work? > > I have tried > sudo adduser ubuntu www-data > and confirmed that ubuntu bel

[web2py] Re: Problem running Web2py DAL (Trunk) as Standalone

2012-07-18 Thread Phyo Arkar
Commenting out : those lines version_info = open(os.path.join(global_settings.gluon_parent, 'VERSION'), 'r') raw_version_string = version_info.read().strip() version_info.close() from fileutils import parse_version # we need fileutils import here, because # fil

[web2py] Re: Internal Error on EC2/Ubuntu

2012-07-18 Thread lyn2py
Correction: changing the permissions back to www-data ironed things out. However, I would like user ubuntu to have access to www-data folder. How can I make it work? I have tried sudo adduser ubuntu www-data and confirmed that ubuntu belongs to the www-data group. But it still doesn't work. Th

[web2py] Re: Problem running Web2py DAL (Trunk) as Standalone

2012-07-18 Thread Phyo Arkar
I canot comprehand why it is searching for a VERSION File inside module folder.. Might be a bug.. On Wednesday, July 18, 2012, Phyo Arkar wrote: > Hello Massimo and all; > > I had to update to trunk version of web2py because we having issue of > web2py DAL not closing down connection , casuing co

[web2py] Problem running Web2py DAL (Trunk) as Standalone

2012-07-18 Thread Phyo Arkar
Hello Massimo and all; I had to update to trunk version of web2py because we having issue of web2py DAL not closing down connection , casuing connections to queue up and then mysql no longer accept connection (Limit reached). But when we run it we get this error: It is just a simple script to te

[web2py] Internal Error on EC2/Ubuntu

2012-07-18 Thread lyn2py
I discovered that after I changed permissions on the web2py folder (chown), web2py registers this internal error. I did this because adding user to the www-data group doesn't give it permissions at all (weird!) Changing the permissions back to www-data:www-data didn't iron things out. Can an e

Re: [web2py] Re: new plugin - web2py Form Wizard - PowerFormWizard

2012-07-18 Thread António Ramos
Also i would be nice in a workflow related document that the tabs that are next in the flow would be highlithed so the user easly sees what is next. Thank you António 2012/7/18 António Ramos > Can i force the form to show the step that is active? > > i want to use this as a workflow between

[web2py] Re: very simple question ...

2012-07-18 Thread Massimo Di Pierro
I cannot reproduce this error with your code. Something else is interfering with it. On Wednesday, 18 July 2012 05:33:53 UTC-5, Ashraf Mansour wrote: > > *Hi, All:* > * > * > *Having these two tables* > > *db.define_table(* > *'salescompany',* > *Field('name') )* > * > * > *db.define_tab

Re: [web2py] Re: Accessing non-returned items in Views

2012-07-18 Thread Anthony
return locals() could also leak private data to the view. Typically not a problem in HTML views as long as you are only including items explicitly, but may be a problem for json and xml views. This is the reason we disabled generic views by default (except on local requests) -- an attacker could

[web2py] Re: KeyError on pyfpdf

2012-07-18 Thread Massimo Di Pierro
Nice. On Wednesday, 18 July 2012 01:46:44 UTC-5, Akash Kakkar wrote: > > PFA Basic example pdf with nested tables using web2py-appreport plugin , > Please let me know if this would work in your case. > > https://github.com/lucasdavila/web2py-appreport > > I can test if you provide me the html of

[web2py] Re: User Login/Logout authentication event

2012-07-18 Thread Massimo Di Pierro
True because there not form submitted on logout, therefore there no acceptance. On Tuesday, 17 July 2012 23:38:34 UTC-5, amit wrote: > > For logout, I could not find logout_onaccept. > There is though: auth.settings.logout_onlogout > I am using v 1.99.7. > --

Re: [web2py] Standalone DAL leaves mysql connections opened

2012-07-18 Thread Phyo Arkar
Is nightly build same with mercurial/git? i tried and db.close() do not exist there. On Wednesday, July 18, 2012, Phyo Arkar wrote: > any resolutions on this? > > On Wednesday, July 18, 2012, Phyo Arkar wrote: > > > I am also having same problem , web2py DAL do not close connection and > fails af

[web2py] Re: sqlform.grid search widget

2012-07-18 Thread Elcimar
Works like a charm, but the "Clear" button is working exactly like the "Search" one, without clearing 'search_text' before submit Is there another method to do that? Em segunda-feira, 16 de abril de 2012 23h32min49s UTC-3, Cliff Kachinske escreveu: > > Good one. > > You earned a browser bookmar

Re: [web2py] Standalone DAL leaves mysql connections opened

2012-07-18 Thread Phyo Arkar
any resolutions on this? On Wednesday, July 18, 2012, Phyo Arkar wrote: > > I am also having same problem , web2py DAL do not close connection and > fails after too many connection on mysql opened. > > I do not have any problem before versions 1.99.1 or 1.99.2 . is that new > bug introduced after

Re: [web2py] Re: Accessing non-returned items in Views

2012-07-18 Thread vinicius...@gmail.com
We know locals() fits well in this situation. But I am working in a system develop returning locals() from all controllers. It's a pain to discover where things are defined and if a change in a controller (ie. killing some "unused" variables) will or not affect that view. Mainly the bigger one

[web2py] cPickle with protocol 2 on a storage object fails

2012-07-18 Thread marius.v.niekerk
When using pickle with protocol 2 pickling a Storage object fails This is caused by the __getattr__ getting called to find the __getinitargs__ and __getnewargs__ methods. They dont exist in the dictionary so consequently they return None. Pickle then calls the None and consequently dies. Imp

[web2py] Re: Altering the appearance of form fields & buttons

2012-07-18 Thread Anthony
See http://web2py.com/books/default/chapter/29/7#Custom-forms. You can also take this approach: http://web2py.com/books/default/chapter/29/7#SQLFORM-in-HTML, though if you want to use the session (which enables CSRF protection), you'd also have to add: Anthony On Wednesday, July 18, 2012 9:

[web2py] Altering the appearance of form fields & buttons

2012-07-18 Thread adohertyd
I have a form that is generated in the controller as follows: form = FORM( INPUT(_name='query', requires=IS_NOT_EMPTY()), INPUT(_type='submit')) if form.process().accepted: session.term=request.vars.query redirect(URL('results_page')) else:

Re: [web2py] Re: new plugin - web2py Form Wizard - PowerFormWizard

2012-07-18 Thread António Ramos
Can i force the form to show the step that is active? i want to use this as a workflow between different users. The first users fills the first step and then submits to the second user. The second user can edit the second step but can only read the first step and so on IS this possible? Thank

[web2py] Re: Standalone DAL leaves mysql connections opened

2012-07-18 Thread Phyo Arkar
I am also having same problem , web2py DAL do not close connection and fails after too many connection on mysql opened. I do not have any problem before versions 1.99.1 or 1.99.2 . is that new bug introduced after 1.99.4 ? coz we are happening at 1.99.4 and up. On Friday, June 22, 2012 10:53:

Re: [web2py] problem with downloading trunk using mercurial

2012-07-18 Thread Richard Vézina
Use command line : hg clone https://code.google.com/p/web2py/ :) Richard On Wed, Jul 18, 2012 at 8:40 AM, simon wrote: > Tortoisehg hangs when I try to download trunk. Does not even let me exit > the program. Has worked perfectly for months and I have not changed > anything. > > Is there a pr

[web2py] problem with downloading trunk using mercurial

2012-07-18 Thread simon
Tortoisehg hangs when I try to download trunk. Does not even let me exit the program. Has worked perfectly for months and I have not changed anything. Is there a problem with the mercurial trunk? Or is it just me having a corrupt file somewhere? --

[web2py] Re: Alternative to Janrain: in pure Python

2012-07-18 Thread Daniel Gonzalez
Hi, Has there been any progress integrating this OAuth library with web2py? Thanks, Daniel On Thursday, July 12, 2012 8:56:25 PM UTC+2, Massimo Di Pierro wrote: > > Thank you Sakesh for the offer. We will work on intergation asap and we > may ask for help with your api. > > massimo > > On Monda

Re: [web2py] Re: new plugin - web2py Form Wizard - PowerFormWizard

2012-07-18 Thread Rahul
Well, this works - you can download the web2py projects from here https://bitbucket.org/rochacbruno/powerformwizard Cheers , Rahul D On Wednesday, July 18, 2012 4:33:12 PM UTC+5:30, Ramos wrote: > > INVALID REQUEST!! > > > > > 2012/7/18 Akash Kakkar > >> Hi Bruno, >> >> The links don't

Re: [web2py] Re: Recommendations on model file size (database tables)

2012-07-18 Thread wdtatenh
Almost 90% of the queries are in DAL and not native SQL. Nothing too elaborate but there are a number of queries with joins - nothing elaborate and simple where clauses. I know the model is not the primary bottleneck as I've got thick controllers that definitely need to be thinned out and re-

[web2py] Re: very simple question ...

2012-07-18 Thread Ashraf Mansour
for these three lines: * * *current_user_id = auth.user.id* ** *xsalescompany_id=db(db.salescompany_user.user_id == current_user_id).select(db.salescompany_user.salescompany_id).first().id* * * *salescompany_name=db(db.salescompany.id == int(xsalescompany_id) ).select(db.sale

Re: [web2py] Re: new plugin - web2py Form Wizard - PowerFormWizard

2012-07-18 Thread António Ramos
INVALID REQUEST!! 2012/7/18 Akash Kakkar > Hi Bruno, > > The links don't work for me (invalid request) > > http://labs.blouweb.com/powerformwizard > > http://labs.blouweb.com > > Thanks, > Akash > > On Wednesday, 29 June 2011 20:03:10 UTC+5:30, rochacbruno wrote: >> >> Hi, >> >> I just cr

Re: [web2py] very simple question ...

2012-07-18 Thread Johann Spies
On 18 July 2012 12:33, Ashraf Mansour wrote: > *Hi, All:* > * > * > *Having these two tables* > > *db.define_table(* > *'salescompany',* > *Field('name') )* > * > * > *db.define_table(* > *'salescompany_user',* > *Field('user_id', db.auth_user , unique = True ),* > *Field('sal

Re: [web2py] Re: Import CSV in appadmin to update database

2012-07-18 Thread Johann Spies
On 18 July 2012 03:41, Mark Li wrote: > I am also unable to import a CSV file using the list:reference format > (exporting then importing with no changes still doesn't work). I get the > error message : > > Unable to parse CSV file > > 'nonetype'object has no attribute '__getitem__' > > > I am no

[web2py] very simple question ...

2012-07-18 Thread Ashraf Mansour
*Hi, All:* * * *Having these two tables* *db.define_table(* *'salescompany',* *Field('name') )* * * *db.define_table(* *'salescompany_user',* *Field('user_id', db.auth_user , unique = True ),* *Field('salescompany_id', db.salescompany) )* *in these three lines* * curre

[web2py] Re: Jeditable and SQLTables

2012-07-18 Thread Simon Ashley
Thanks Brent, Eventually got it with your help and advice. The controller was failing silently (revealed with Firefox and Firebug). Once that was fixed, plugged the rest in and worked perfectly. (kicking myself that it was so close, but you stuff really helped. I owe you one) Cheers, On Wednesd

[web2py] Re: Web2py expert needed for start-up

2012-07-18 Thread Neil
How does the experts4solutions website work? For example, if I wanted to see if anyone (anywhere) was interested in a paid hourly contract, would I have to send an individual email to each expert listed? Who does the "contact us" form get sent to? It would be really useful to be able to post pr

[web2py] Re: TAKE 2: Web2py + (jython / modjy) + Tomcat 6

2012-07-18 Thread Duncan
Hi again, On Wednesday, 18 July 2012 10:35:11 UTC+10, Massimo Di Pierro wrote: > > I would be very much interested in a web2py war file! We can distribute it > directly from the web2py.com > > It would be great, wouldn't it? There would probably have to be some caveats -- probably just some usag

[web2py] Using mixed authentication - OpenID + local database

2012-07-18 Thread murtaza52
Hi, I am creating an app that will act as a central login module and also SSO. The following are the use cases - User email is @googledomain 1) User navigates to an app "abc". 2) User is redirected to the login module. 3) User is prompted for username and password. 4) User enters a username @g

[web2py] Re: Need a little help with DAL

2012-07-18 Thread Aurelijus Useckas
This worked! thnx a lot ;) On Tuesday, July 17, 2012 2:00:37 PM UTC+3, Anthony wrote: > > Note, SQLite cannot drop fields -- see > http://web2py.com/books/default/chapter/29/6#Fixing-broken-migrations. How > about if you create a fresh database (i.e., delete everything from the > databases fold

[web2py] Re: Scheduler: help us test it while learning

2012-07-18 Thread Niphlod
STOPPED tasks gets requeued as soon as there is an ACTIVE worker around. The "philosophy" behind is that if a worker has been stopped (abruptly) your task never finished, so it gets "another shot" with the next worker. The scheduler_run table will grow as long as you need results. As documented,