[web2py] Re: Initialize one-time configuration data in DB

2012-08-09 Thread mrtn
> If they must be in the database, use a script to import them and run it > once > python web2py.py -S yourapp -M -N -R yourscript.py Yes, the data must be in the db. By 'import them' in the script, do you mean import the database abstraction layer stuff by web2py, and use it to insert the

[web2py] Initialize one-time configuration data in DB

2012-08-08 Thread mrtn
Hi, I need to have a few rows of data in the database for configuration purposes. I just need to set them once and forget about them, in some sense that they are like 'constants'. What is the best approach to do this with web2py? Or should I just do it completely separately from web2py, e.g.

[web2py] How to update fields from different tables in a single form

2012-07-16 Thread mrtn
Hi, I have a field (say 'field_a') from table 'A', and a field ('field_b') from table 'B', and the two tables are linked such that they share a field. Now I want to create a single form in a view which updates both 'field_a' and 'field_b' in one submission. What is the proper way of doing this

[web2py] Re: Use of custom CSS, HTML and JS for the view

2012-06-29 Thread mrtn
One follow-up question: More generally, if a controller action returns a form object to the view, how does the view renders the fields/variables in that form? Does the rendering depend on web2py.css and/or web2py.js? If so, does it mean that I have to manually set the variables (such as form.v

[web2py] Re: Use of custom CSS, HTML and JS for the view

2012-06-29 Thread mrtn
Thanks a lot for the clarifications!

[web2py] Use of custom CSS, HTML and JS for the view

2012-06-28 Thread mrtn
Hi, I am trying to use some custom CSS (web2py.css is not used due to potential conflict), HTML and JS (web2py.js is also not used). Now I wonder how should I tell web2py to link up these custom resources? Do I still have to use layout.html and web2py_ajax.html and modify them accordingly to u

[web2py] Re: uwsgi enable-thread option and web2py

2012-06-18 Thread mrtn
, 18 June 2012 11:34:39 UTC-5, mrtn wrote: >> >> >> I'm deploying web2py with uwsgi 1.2.3, and upon starting the app, there >> is message in the uwsgi log says; >> >> *** Python threads support is disabled. You can enable it with >> --enable-threads

[web2py] uwsgi enable-thread option and web2py

2012-06-18 Thread mrtn
I'm deploying web2py with uwsgi 1.2.3, and upon starting the app, there is message in the uwsgi log says; *** Python threads support is disabled. You can enable it with --enable-threads *** And in the uwsgi doc, it says the following for option enable-thread: Enable threads in the embedded la

Re: [web2py] Dedicated IDE

2012-05-15 Thread mrtn
> I am working exclusively with web2py, over 2 years (8-24 hours a day *7) > plus holydays. And I never used an IDE. I use Sublime-text-2 and VIM, I > have Python code completion and I have set some web2py completions for > common code snippets both in VIM and Sublime-text. > But, If I wanted

[web2py] Setup web2py in virtualenv

2012-05-10 Thread mrtn
I have installed virtualenv and setup an environment for a web2py project. I came across a post before where people say you can use pip to install web2py, but it is still experimental and possibly not working well. I wonder if I can just copy the whole web2py source folder to somewhere (/bin,

[web2py] Re: Options for making a chat application with web2py

2012-05-04 Thread mrtn
ng to use it (not for chat but for other real-time messaging) > and it seems to be working pretty well in test. > > On Wednesday, May 2, 2012 3:48:41 PM UTC-7, mrtn wrote: >> >> >> So I've done some research on developing a chat app with web2py. First, I >>

[web2py] Re: Options for making a chat application with web2py

2012-05-03 Thread mrtn
Thanks! I think I will try SockJS. My main concern with Socket.io is that it does not seem to be well maintained and the documentation is not very good. If there is any other alternative, please feel free to list here. On Wednesday, May 2, 2012 10:28:29 PM UTC-4, Anthony wrote: > > Looks like

[web2py] Re: Options for making a chat application with web2py

2012-05-02 Thread mrtn
Thanks for the recommendation. if I understand gevent-socketio (https://github.com/abourget/gevent-socketio) correctly, it is the same idea as Tornadio except that it replaces Tornado with Gevent. Is there any alternative that does not utilize Socket.io? If not, is there any working code maki

[web2py] Options for making a chat application with web2py

2012-05-02 Thread mrtn
So I've done some research on developing a chat app with web2py. First, I took a look of: http://code.google.com/p/web2py/source/browse/gluon/contrib/comet_messaging.py, and then a related tutorial using it: http://vimeo.com/38972256 (not in english, so I might have missed a thing or two). Wha

[web2py] How to manage redundant files for application version control

2012-04-27 Thread mrtn
Hi, I'm using Git (Github) to manage my app development in Web2py. I noticed that each time when I make a commit lots of runtime generated files such as error tickets, logs, db files, etc are picked up by Git, which probably shouldn't be checked in as part of the codebase. These files exist at

[web2py] Re: how does Web2py resolve this variable in the link string

2012-04-22 Thread mrtn
Some digging in the Web2py source code reveals that the variable merely holds a string which contains a variable 'key' that is set to 'registration_key' field of the auth_user table.

[web2py] Conditional re-direction to enforce page sequence

2012-04-20 Thread mrtn
I have a 'registered' page/action which immediately follows 'register' page/action, and I would like to prevent someone who is currently on the 'register' page to jump to 'registered' page by directly changing the URL (even if all the fields including email etc are filled), instead of clicking

[web2py] Re: How can one retrieve user's email upon verify_email action

2012-04-20 Thread mrtn
Thanks for the suggestion, Anthony. When you said '*an argument* of the verify_email_onaccept callback', you meant an argument of the callback function supplied to auth.settings.verify_email_onaccept , right? My understanding is that you provide a callback function to Web2py, which is going t

[web2py] Re: How can one retrieve user's email upon verify_email action

2012-04-19 Thread mrtn
I've tried to retrieve the email address using 'form.vars.email', but it gives me KeyError exception. I guess this is because that there is barely anything in the 'form' object returned by auth.verify_email()

[web2py] How can one retrieve user's email upon verify_email action

2012-04-19 Thread mrtn
Hello, I am using the provided 'verify_email' action exposed by Auth facilities to verify each user's registration. I wonder if there is a way for retrieving user's email (the one that is being verified) so that a welcome message can be sent upon the success of verification. I intend to do th

[web2py] how does Web2py resolve this variable in the link string

2012-04-19 Thread mrtn
Hello, I am new to Web2py, and while I am going through the manual, I encountered the following code: auth.messages.verify_email = 'Click on the link http://' + \ request.env.http_host + \ URL(r=request,c='default',f='user',args=['verify_email']) + \ '/%(key)s to verify your email