[web2py] Re: SQLFORM smart grid child table fields and editing excelike

2014-07-16 Thread Yebach
models for two tables that need to be shown db.define_table('worker', Field('id', type ='id'), Field('w_organisation', type ='integer'), Field('w_user', type ='integer'), Field('w_status', 'reference status'), Field('w_first_name',type='text'), Field('w_last_name',type='text'),

[web2py] Re: CKeditor in a loaded component

2014-07-16 Thread Leonel Câmara
Rahul you use the XML helper. For instance, let's suppose I have a table 'page' with a field 'body' which I have set with ckeditor. In the view I can do: {{=XML(page.body, sanitize=False)}} If you can trust the input sanitize=False is a good idea (for instance if it can only be changed in the

[web2py] sessions2trash.py and memory usage

2014-07-16 Thread Annet
To clean up session on my production environment I thought of calling the sessions2trash.py this way: nohup python ~/webapps/w2p/web2py/web2py.py -S admin -R scripts/sessions2trash.py -A -o -x 3600 -f -v -s nohup python ~/webapps/w2p/web2py/web2py.py -S myleonexus -R scripts/sessions2trash.py

[web2py] Re: sessions2trash.py and memory usage

2014-07-16 Thread Niphlod
14 MB is over your limit ? change hosting provider. On Wednesday, July 16, 2014 10:46:58 AM UTC+2, Annet wrote: To clean up session on my production environment I thought of calling the sessions2trash.py this way: nohup python ~/webapps/w2p/web2py/web2py.py -S admin -R

[web2py] Re: sessions2trash.py and memory usage

2014-07-16 Thread Annet
No, all these lines added up to 549 MB, my limit is 512 MB. I commented out: */5 * * * * ~/webapps/w2p/web2py/web2py.py -S admin -R scripts/sessions2trash.py */5 * * * * ~/webapps/w2p/web2py/web2py.py -S mypynex -R scripts/sessions2trash.py in my cron tab, which solves the issue, however, I

[web2py] Re: SQLFORM smart grid child table fields and editing excelike

2014-07-16 Thread Yebach
Also, how do I costumize the edit view (etc. drop down menus, filed size). The input text fields are enormous. Using set max length does not work. It prevents the text larger then set to be inserted (but only on submit button click it rases an error - is it possibel to create an on the fly

[web2py] Problem with Google Fonts

2014-07-16 Thread Thiago Duarte
Hello! I'm having a problem: I upload a file with the following code in my application static folder (I'm using PythonAnywhere): html head link rel=stylesheet type=text/css href= http://fonts.googleapis.com/css?family=Nunito; style #font { font-family: 'Nunito', sans-serif; font-size: 48px;

[web2py] How to deploy web2py under existing host

2014-07-16 Thread chuan137
Hi All, I have to install web2py as part existing VirtualHost. It is serving a few directories, and web2py folder is one of them. this is my settings under VirtualHost superhostname:80 WSGIScriptAlias /newstatus /srv/www/hostRoot/web2py/wsgihandler.py Directory

[web2py] Re: Styling columns in SQLTABLE and the grid

2014-07-16 Thread Кирилл Шаталаев
Hello, there is a little trouble. When I hide some fields from output by db.table.field.readable=False, th and td are not rendered (as it must), but col in colgroup for this field is still rendered so it breaks the layout. пятница, 8 ноября 2013 г., 1:01:48 UTC+4 пользователь Anthony написал:

[web2py] Re: error(10053, 'An established connection was aborted by the software in your host machine')

2014-07-16 Thread Massimo Di Pierro
This is not the problem. You should not close connections in web2py. web2py may need to recycle them in the connection pool. Can you connect to your database via other means? For example the python shell or the web2py shell? On Tuesday, 15 July 2014 14:08:22 UTC-5, Copper Lark wrote: I

[web2py] Re: sessions2trash.py and memory usage

2014-07-16 Thread Niphlod
did you try to inspect the log of the cron job adding a -v , i.e. web2py.exe -S mypynex -M -R scripts/sessions2trash.py -A -o -x 3600 -f -v ? On Wednesday, July 16, 2014 11:48:36 AM UTC+2, Annet wrote: No, all these lines added up to 549 MB, my limit is 512 MB. I commented out: */5 * * *

[web2py] Re: Problem with Google Fonts

2014-07-16 Thread Leonel Câmara
I don't see anything wrong with it (well you could use https instead of http so it also works if you're browsing it using https). Can you clarify exactly when does it not work? What do you mean by when I open the page of the uploaded file? -- Resources: - http://web2py.com -

[web2py] Re: SQLFORM smart grid child table fields and editing excelike

2014-07-16 Thread Anthony
workers = db(db.worker.w_organisation == 10).select(db.worker.w_id_w, db.worker.w_organisation, db.worker.w_first_name, db.worker.w_last_name,db.worker.w_nick_name,db.worker.w_email,db.worker.w_status,db.worker.w_note).as_list() What is the above for? It is not used below. #Define the

Re: [web2py] Re: Favorite debuggers?

2014-07-16 Thread Don O'Hara
Thanks Ron - My preferred way has always been to log now, look later to not interupt the flow of the transaction/unit of work processing. Most of my day work is database programming where debugging is very limited or non-existent, and that's the only way. (Nothing worse than staring at code and

Re: [web2py] Re: SQLFORM smart grid child table fields and editing excelike

2014-07-16 Thread Vid Ogris
Hell I changed to SQLFORM.grid. It kind of works now. I even managed to include status as drop down in my edit view. I created a left join on my status table. The problem I am facing now is that when a user selects a status for worker and clicks submit I get an error. looks like it is trying

[web2py] PythonAnywhere Web2py Script

2014-07-16 Thread Tom Russell
I am trying to run a script that I have in my app. While the log files seem to show my script ran, it does not update the db I have for my app. On the schedule tab in pythonanywhere I have this set up so not sure if it is correct: python2.7 /home/tsrdatatech/web2py/web2py.py -S

Re: [web2py] Re: SQLFORM smart grid child table fields and editing excelike

2014-07-16 Thread Anthony
#Validators * db.worker.w_status.requires = IS_IN_DB(db,db.status.s_code) # This created drop down but does not insert the right value into field* Because w_status is a reference field, it must store the record ID from the db.status table, not the s_code value (which is a text field). If

[web2py] Re: sessions2trash.py and memory usage

2014-07-16 Thread Annet
Since I have access to my system's own cron service I use *external cron* The issue seems to be that */5 * * * * ~/webapps/w2p/web2py/web2py.py -S admin -R scripts/sessions2trash.py */5 * * * * ~/webapps/w2p/web2py/web2py.py -S mypynex -R scripts/sessions2trash.py are starting web2py and

[web2py] Relative URLs in development absolute URLs in production

2014-07-16 Thread Annet
I have a development and a deployment environment. In development all URLs are relative. The issue is I have 2 applications, 1 over http and 1 over https. When I move my applications to production I have to add scheme= ...and host=... to all URLs that are links between the 2 applications. Which

[web2py] Ractive, web2py and forms, enable the automatically disabled submit button

2014-07-16 Thread Leonel Câmara
Hey, I'm doing something similar to this example: http://examples.ractivejs.org/comments I'm having a problem because my comment form submit button gets set to working... and disabled. I sort of like it but I'd like to be able to re-enable it. What I have tried to do is, in the bottom of my

Re: [web2py] Ractive, web2py and forms, enable the automatically disabled submit button

2014-07-16 Thread Richard Vézina
May this help : http://stackoverflow.com/questions/10073434/find-this-when-using-jquery-on-with-dynamically-created-elements ?? Richard On Wed, Jul 16, 2014 at 1:28 PM, Leonel Câmara leonelcam...@gmail.com wrote: Hey, I'm doing something similar to this example:

Re: [web2py] PythonAnywhere Web2py Script

2014-07-16 Thread Stef Mientki
I'm not sure what all those command line parameters mean, so I don't know if this helps, but I run the same script on my Desktop, Raspberry Pi and PythonWhyWhere without parameters in the following way: # detect if I'm on PythonAnyWhere import platform Uname = platform.uname () CurDir =

[web2py] User_agent in a LOADed view

2014-07-16 Thread Louis Amon
I'm a great fan of LOAD, and i'm using it quite a bit to generate cool ajax pages. I got one issue so far though : can't seem to *cleanly* detect a mobile device in a .load view. For example I have a result.load view and I want a special mobile display in result.mobile.load. I've tried to

[web2py] Re: sessions2trash.py and memory usage

2014-07-16 Thread Niphlod
I'm starting to think we talk two different languages (and there's a little bit of lack of shell scripting on your side). cron syntax is a taddle bit universal that being said there is a subtle difference between web2py's cron and a normal cron (explained in the book). Cron is made

[web2py] Re: User_agent in a LOADed view

2014-07-16 Thread Anthony
Please show your code and the exception. On Wednesday, July 16, 2014 4:15:27 PM UTC-4, Louis Amon wrote: I'm a great fan of LOAD, and i'm using it quite a bit to generate cool ajax pages. I got one issue so far though : can't seem to *cleanly* detect a mobile device in a .load view. For

[web2py] Re: User_agent in a LOADed view

2014-07-16 Thread Louis Amon
Sure. It's fairly simple tho since the Exception gets raised on line 1 of my LOADed view. Views/default/search.html: ... {{ =LOAD('service', 'serv1') }} ... Controllers/service/serv1: response.view = service.load def serv1(): return dict() Views/service.load : {{ is_mobile =

[web2py] Re: sessions2trash.py and memory usage

2014-07-16 Thread Jose C
Hi Annet, I'm also with webfaction and do my session cleanups like this: (this is one line in the crontab): # Delete sessions that are older than 1 day from the disk. 18 1 * * * /usr/local/bin/python2.7 /home/my_username/webapps/my_w2p_app_dir /web2py/web2py.py --nogui --no-banner -S

[web2py] Re: how to trigger submit action of form(SQLFORM) under separated div(outside form)

2014-07-16 Thread Dave S
On Tuesday, July 1, 2014 6:46:29 AM UTC-7, Andrey K wrote: Dear web2py users, I have a straight forward need in trigger submit action of sqlform outside of form div - by clicking other button and hide original submit button on the form. Can I do it and how? I'm going to guess that

Re: [web2py] Re: Favorite debuggers?

2014-07-16 Thread Tim Richardson
Pydev on top of eclipse is very strong. Pydev is evolving fast. I use pycharm pro (which is web2py aware), the community edition is worth trying. The web2py book has tips on using IDEs which are not web2py -aware. Web2py's IDE is improving too, every time I look it is getting better. --

[web2py] Re: User_agent in a LOADed view

2014-07-16 Thread Anthony
Note, you are using a non-Ajax component. I'm not sure why request.user_agent isn't defined in that case, but there are some funky things going on with non-Ajax components, so I would instead recommend using Ajax components: {{=LOAD('service', 'serv1', ajax=True)}} Feel free to file a Google

[web2py] Re: how to trigger submit action of form(SQLFORM) under separated div(outside form)

2014-07-16 Thread lyn2py
You could use display:none but what if the user hits enter instead? On Tuesday, July 1, 2014 9:46:29 PM UTC+8, Andrey K wrote: Dear web2py users, I have a straight forward need in trigger submit action of sqlform outside of form div - by clicking other button and hide original submit button

Re: [web2py] Delete Query Not Working

2014-07-16 Thread dlypka
you might need to db.commit() after the delete(). versioning might be doing a commit() for you. On Tuesday, July 15, 2014 9:05:09 AM UTC-5, samurai wrote: No, I hadn''t. But it worked on turning it on. Thanks But I don't get it. Record versioning just creates an archived db for the

[web2py] Re: CKeditor in a loaded component

2014-07-16 Thread Rahul
Thanks! Leonel. That helps. :-) Cheers, Rahul. On Wednesday, July 16, 2014 1:55:50 PM UTC+5:30, Leonel Câmara wrote: Rahul you use the XML helper. For instance, let's suppose I have a table 'page' with a field 'body' which I have set with ckeditor. In the view I can do: