[web2py] Re: web2py logging logging.conf multiple files
On Sunday, August 10, 2014 8:23:56 AM UTC+5:30, Leonel Câmara wrote: That's not really an issue, it's using a rotating log, once log reaches max size it creates one of those numbered ones, copies the content there and creates a new one. Your most recent log is the file without a number. Not really- here are the date values from the files (grep | cut| sort -u) - *my_log.log.1:2014-08-08* *my_log.log:2014-08-08* my_log.log:2014-08-09 my_log.log.2:2014-08-06 my_log.log.2:2014-08-07 *my_log.log.2:2014-08-08* my_log.log.3:2014-08-06 my_log.log.3:2014-08-07 *my_log.log.3:2014-08-08* my_log.log.3:2014-08-09 my_log.log.4:2014-07-31 my_log.log.4:2014-08-06 my_log.log.4:2014-08-07 *my_log.log.4:2014-08-08* my_log.log.4:2014-08-09 my_log.log.5:2014-07-24 my_log.log.5:2014-07-26 my_log.log.5:2014-07-27 So data is getting written to multiple files at the same time, I feel. Since I have a PostgreSQL external table pointing to the file, it becomes a more severe issue. I end up dropping records. I have tried guessing the issue here http://stackoverflow.com/questions/25215677/web2py-and-python-logging For now, I have really increased the max file size. Let me wait and watch. Hope this helps someone. -- 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: web2py logging logging.conf multiple files
https://docs.python.org/2/library/logging.handlers.html#rotating-file-handler -- 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] Send data to print.
Hi, I need help with something like that: I want to create a simple print app, where a user picks some options, presses print, it is sent to the controller, then the controller print the string directly to the printer. Any suggestions/directions? Thanks, Avi. -- 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] MARKMIN italics not working with didn't
Just spotted this bug. If you have a ' in your text, it cannot be italicized, instead it is printed as is. Examples to test: ''try this, it works'' ''but then this doesn't work'' -- 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: Send data to print.
What is the location of the printer? If this is going to be on the client side, then you'll need to open the browser print dialog. You can use javascript to do so, plenty of examples can be found on the web. Regards On Sunday, August 10, 2014 1:20:05 PM UTC+2, Avi A wrote: Hi, I need help with something like that: I want to create a simple print app, where a user picks some options, presses print, it is sent to the controller, then the controller print the string directly to the printer. Any suggestions/directions? Thanks, Avi. -- 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: Send data to print.
I want the users to open the app from mobile devices, andriod and ios, and i want the process to be transparent for them. I mean they shoudn't install a print app and they shouldn't define/associate a printer to the device, as opposed to clicking share, letting the server/controller handle printing and setting. the printer would be connected the to the server with cable. On Sunday, August 10, 2014 3:01:44 PM UTC+3, LightDot wrote: What is the location of the printer? If this is going to be on the client side, then you'll need to open the browser print dialog. You can use javascript to do so, plenty of examples can be found on the web. Regards On Sunday, August 10, 2014 1:20:05 PM UTC+2, Avi A wrote: Hi, I need help with something like that: I want to create a simple print app, where a user picks some options, presses print, it is sent to the controller, then the controller print the string directly to the printer. Any suggestions/directions? Thanks, Avi. -- 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: Send data to print.
I think this is what i need or something similar: https://pypi.python.org/pypi/pycups On Sunday, August 10, 2014 3:45:02 PM UTC+3, Avi A wrote: I want the users to open the app from mobile devices, andriod and ios, and i want the process to be transparent for them. I mean they shoudn't install a print app and they shouldn't define/associate a printer to the device, as opposed to clicking share, letting the server/controller handle printing and setting. the printer would be connected the to the server with cable. On Sunday, August 10, 2014 3:01:44 PM UTC+3, LightDot wrote: What is the location of the printer? If this is going to be on the client side, then you'll need to open the browser print dialog. You can use javascript to do so, plenty of examples can be found on the web. Regards On Sunday, August 10, 2014 1:20:05 PM UTC+2, Avi A wrote: Hi, I need help with something like that: I want to create a simple print app, where a user picks some options, presses print, it is sent to the controller, then the controller print the string directly to the printer. Any suggestions/directions? Thanks, Avi. -- 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: MARKMIN italics not working with didn't
I think changing markmin regex_em from ''(?Pt[^\s']+(?: +[^\s']+)*)'' to ''(?Pt([^\s']| |'(?!'))+)'' would solve this. -- 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: Trouble Creating Update Form
I made the changes and switched to using {{=form}}, but It's still creating a new record. I just realized I didn't post a part of the view that might be causing the issue. I have multiple forms on a single page. ... {{=for row in rows:}} {{=form}} {{pass}} ... Could that be causing the issue? I went ahead and uploaded what I have to Python Anywhere to help illustrate what I'm trying to do. You can check it out here https://drewhowell.pythonanywhere.com/TwoFiveTracker/default/workouts (the layout is slightly broken because of the vertical radio buttons, but that will be fixed next). On Saturday, August 9, 2014 10:33:02 PM UTC-4, Massimo Di Pierro wrote: One problem is that you want to select after you process the form: def workouts(): r = db.workouts(request.args(0)) form = SQLFORM(db.workouts, r).process() if form.accepted: response.flash = 'form accepted' elif form.errors: response.flash = 'form has errors' rows = db(db.workouts).select() return locals() Also instead of using a custom form (unless you really need one), I suggest you do {{=form}} in view and make the fields that you do not need in the form Field(..., readable=False, writable=False) On Saturday, 9 August 2014 20:01:51 UTC-5, Drew Howell wrote: I'm new to Web2Py, so I am creating a (what I thought was a) simple app that tracks progress of a workout routine. I have a database (db.workouts) that has information such as Workout Name, Rating, Completed, etc. I have 2 fields(rating, completed) I would like to update via a form. I have tried a couple different methods, but can't seem to get anything to work correctly. The other fields are already entered in the table and should not be changed. Rating should be updated by a set of radio buttons and Completed should be set to 0 when the form is submitted (0=complete, 1=current, 2=locked). I have created the form, but have done something wrong because, when it is submitted, a new record is created rather than updating the existing one. *Here is my code:* *Model:* db.define_table('workouts', Field('stage'), Field('w', type=integer), Field('workout'), Field('complete', type=integer), Field('d', type=integer), Field('rating', requires=IS_IN_SET([1, 2, 3, 4 ]), widget=SQLFORM.widgets.radio.widget), auth.signature ) *Controller:* def workouts(): rows = db(db.workouts).select() r = db.workouts(request.args(0)) form = SQLFORM(db.workouts, r) if form.process().accepted: response.flash = 'form accepted' elif form.errors: response.flash = 'form has errors' return locals() *View:* ... {{=form.custom.begin}} {{=form.custom.widget.rating}} {{=form.custom.submit}} {{=form.custom.end}} ... As I mentioned earlier, I am new and I may be going about this completely the wrong way. So any help would be greatly appreciated. I can provide more information if needed. Thanks. -- 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: init.d script samples
OK, for fun... I changed DAEMON_USER=web2py to root to see what would happen... I then ran /etc/init.d/web2py start. I was prompted for a password and the service started taking over the CLI as if I had launched it from the CLI directly. root@beaglebone:/etc/init.d# web2py start web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2014 Version 2.9.5-stable+timestamp.2014.03.16.02.35.39 Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(pg8000), IMAP(imaplib) WARNING:web2py:GUI not available because Tk library is not installed choose a password: please visit: http://127.0.0.1:8000/ use kill -SIGTERM 8504 to shutdown the web2py server I'm officially back to stuck and could use some pointers. Thanks, -p On Saturday, August 9, 2014 4:33:58 PM UTC-10, Patrick Walters wrote: I have made much progress on this since I posted and it got approved. 1) I was using python syntax in a bash script... :-) I removed the () and switched to single quotes. DAEMON_ARGS='web2py.py -a t3st3st -i 192.168.1.20 -p 8000 -c /usr/share/ssl-cert/server.crt -k /usr/share/ssl-cert/server.key --pid_filename=$PIDFILE' 2) the version of web2py in python-web2py from apt-get was old. I deleted /usr/sahrewb2py and then downloaded and copied web2py from github to /usr/share/web2py It still fails when I try /etc/init.d/web2py start, but now I am at least getting useful errors. root@bbbrevc:/# /etc/init.d/web2py status web2py.service - LSB: web2py initscript Loaded: loaded (/etc/init.d/web2py) Active: failed (Result: exit-code) since Sat, 09 Aug 2014 16:27:38 -1000; 4min 40s ago Process: 4552 ExecStart=/etc/init.d/web2py start (code=exited, status=2/INVALIDARGUMENT) CGroup: name=systemd:/system/web2py.service Aug 09 16:27:38 bbbrevc web2py[4552]: Starting Web Framework: web2pychown: ...y' Aug 09 16:27:38 bbbrevc web2py[4552]: start-stop-daemon: user 'web2py' not found Aug 09 16:27:38 bbbrevc web2py[4552]: failed! Have to run out but I'll be back online in a few hours and back at this... if anyone has a suggestion still would love the help. Thanks, -p On Saturday, August 9, 2014 1:12:41 PM UTC-10, Patrick Walters wrote: I'm setting up on a BeagleBone Black Rev C running Debian and following along with the book where I can. I should mentions I installed web2py using apt-get and my Debian is Wheezy. I never use the desktop on my BBB, so I want everything to work without GUI. I was able to run web2py from the CLI and now I want to set it up to run as a service. The python-web2py in debian doesn't include the scripts directory (that I can find) so I grabbed https://github.com/web2py/web2py/blob/master/scripts/web2py.ubuntu.sh and modified it for debian replacing the DAEMON_DIR=/usr/lib/$NAMEwith DAEMON_DIR=/usr/share/$NAME when I run that /etc/init.d/web2py start I get all the same GTK errors when I try to run it from the CLI without specifying a password. So, just to try this out, I modified DAEMON_ARGS=web2py.py --password=recycle --pid_filename=$PIDFILEto have ALL the CLI argument I passed when I was able to run it manually. DAEMON_ARGS=(web2py.py --nogui -a 'password' -i 192.168.1.100 -p 8000 + -c /usr/share/ssl-cert/server.crt -k /usr/share/ssl-cert/ssl/server.key + --pid_filename=$PIDFILE) I even added in --nogui for safe measure, but i'm still getting the GTK errors when I run /etc/init.d/web2py start. Any suggestions or pointers for more information would be very helpful. Thanks, -p -- 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] IDE for using web2py on windows
Am new to web2py looking for better IDE support been using spyder for my other work on windows. Can I continue to use same or need to move to some other IDE? -- 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: MARKMIN italics not working with didn't
good catch. Fixed in trunk. On Sunday, 10 August 2014 09:30:37 UTC-5, Leonel Câmara wrote: I think changing markmin regex_em from ''(?Pt[^\s']+(?: +[^\s']+)*)'' to ''(?Pt([^\s']| |'(?!'))+)'' would solve this. -- 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] Web2py vs ruby on rails for a startup?
I am trying to zero on web framework for our startup, requirements a. Security ( we are working on financial info hence this is important) b. Good way of accessing algos/data of python Machine learning programs c. Low cost of hosting and development (a strartup with not much funds :-) looking for cloud hosting options. d. Relatively low userbase maybe a 1 million in a year's time (looking to server niche ) After reading a bit have zeroed on Ruby on Rails and Web2Py. Looks like ROR is extremly quick, but might have higher hosting costs.. difficulty of mainitaining etc. other hand web2py seems to pull good things from ROR, but very small community and still early stages.. Please suggest, other suggestion liky Play, django etc. welcome if you feel strongly -- 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: Web2py, authenticating two types of profile
nobody know how we can create two types of accounts or login ? Le samedi 9 août 2014 00:27:03 UTC+2, eric cuver a écrit : hello everybody, i want create one application. i need to create two types of accounts or login. Each of them should be able to register/login/... buyer/customer account defined by different tables in db. how i can do with web2py thank you -- 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: Web2py vs ruby on rails for a startup?
In my opinion the server costs are negligible whichever way you go. Most RoR users like Heroku (no persistent file system, only db storage, autoscale). For web2py we tend to prefer PythonAnywhere.com (like a vps but autoscale) and Google App Engine (better autoscale than anything but no filesystem, only db storage). For both if the number of users is not too intensive, you can use any normal virtual machine. I like DigitalOcean.com. It is cheap and easy to use. The main issue here is (b). Your algorithms are likely to be in Python (numpy/scipy/scikit/etc) and it will be much much easier to access them from a Python framework. In web2py we provide a built-in scheduler which allows you (if you run on a VPS) to submit computing intensive tasks and execute them asynchronously and in parallel. I have worked a lot with financial applications. For example I have worked with the Vertica database to fetch stock quotes. Both web2py and RoR can talk to Vertica but in the case of web2py you can use the database abstraction layer, in case of RoR you have to use SQL. About security (a). You cannot beat the security of web2py. Friday I am giving a talk at OWASP in Orange County about this. I will post slides. The University where I teach was one of the first in the country to receive a certificate of excellence from the NSA. This was not about web2py but this is to say we are security experts. Costs of development are probably the same but it will be harder to find web2py developers but finding good RoR developers is also hard. Maintenance costs are lower in web2py. Anyway, I am sure others here have some opinions to share. Massimo On Sunday, 10 August 2014 01:43:02 UTC-5, Suresh Mali wrote: I am trying to zero on web framework for our startup, requirements a. Security ( we are working on financial info hence this is important) b. Good way of accessing algos/data of python Machine learning programs c. Low cost of hosting and development (a strartup with not much funds :-) looking for cloud hosting options. d. Relatively low userbase maybe a 1 million in a year's time (looking to server niche ) After reading a bit have zeroed on Ruby on Rails and Web2Py. Looks like ROR is extremly quick, but might have higher hosting costs.. difficulty of mainitaining etc. other hand web2py seems to pull good things from ROR, but very small community and still early stages.. Please suggest, other suggestion liky Play, django etc. welcome if you feel strongly -- 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: IDE for using web2py on windows
You can use Spyder but it may not recognize for of the web2py keywords. There are tricks: add gluon to path and add if False: from gluon import * to models and controllers. On Sunday, 10 August 2014 05:30:46 UTC-5, Suresh Mali wrote: Am new to web2py looking for better IDE support been using spyder for my other work on windows. Can I continue to use same or need to move to some other IDE? -- 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: Trouble Creating Update Form
That's it then. You cannot have multiple forms on the same type on one page unless they refer to different tables. There are other ways but it really depends on what you are trying to do. Can you explain in words what is the page supposed to do. On Sunday, 10 August 2014 11:11:05 UTC-5, Drew Howell wrote: I made the changes and switched to using {{=form}}, but It's still creating a new record. I just realized I didn't post a part of the view that might be causing the issue. I have multiple forms on a single page. ... {{=for row in rows:}} {{=form}} {{pass}} ... Could that be causing the issue? I went ahead and uploaded what I have to Python Anywhere to help illustrate what I'm trying to do. You can check it out here https://drewhowell.pythonanywhere.com/TwoFiveTracker/default/workouts (the layout is slightly broken because of the vertical radio buttons, but that will be fixed next). On Saturday, August 9, 2014 10:33:02 PM UTC-4, Massimo Di Pierro wrote: One problem is that you want to select after you process the form: def workouts(): r = db.workouts(request.args(0)) form = SQLFORM(db.workouts, r).process() if form.accepted: response.flash = 'form accepted' elif form.errors: response.flash = 'form has errors' rows = db(db.workouts).select() return locals() Also instead of using a custom form (unless you really need one), I suggest you do {{=form}} in view and make the fields that you do not need in the form Field(..., readable=False, writable=False) On Saturday, 9 August 2014 20:01:51 UTC-5, Drew Howell wrote: I'm new to Web2Py, so I am creating a (what I thought was a) simple app that tracks progress of a workout routine. I have a database (db.workouts) that has information such as Workout Name, Rating, Completed, etc. I have 2 fields(rating, completed) I would like to update via a form. I have tried a couple different methods, but can't seem to get anything to work correctly. The other fields are already entered in the table and should not be changed. Rating should be updated by a set of radio buttons and Completed should be set to 0 when the form is submitted (0=complete, 1=current, 2=locked). I have created the form, but have done something wrong because, when it is submitted, a new record is created rather than updating the existing one. *Here is my code:* *Model:* db.define_table('workouts', Field('stage'), Field('w', type=integer), Field('workout'), Field('complete', type=integer), Field('d', type=integer), Field('rating', requires=IS_IN_SET([1, 2, 3, 4 ]), widget=SQLFORM.widgets.radio.widget), auth.signature ) *Controller:* def workouts(): rows = db(db.workouts).select() r = db.workouts(request.args(0)) form = SQLFORM(db.workouts, r) if form.process().accepted: response.flash = 'form accepted' elif form.errors: response.flash = 'form has errors' return locals() *View:* ... {{=form.custom.begin}} {{=form.custom.widget.rating}} {{=form.custom.submit}} {{=form.custom.end}} ... As I mentioned earlier, I am new and I may be going about this completely the wrong way. So any help would be greatly appreciated. I can provide more information if needed. Thanks. -- 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: IDE for using web2py on windows
I would recommend Pycharm quite a mature ide. http://www.jetbrains.com/pycharm/webhelp/creating-web2py-project.html On Sun, Aug 10, 2014 at 10:53 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You can use Spyder but it may not recognize for of the web2py keywords. There are tricks: add gluon to path and add if False: from gluon import * to models and controllers. On Sunday, 10 August 2014 05:30:46 UTC-5, Suresh Mali wrote: Am new to web2py looking for better IDE support been using spyder for my other work on windows. Can I continue to use same or need to move to some other IDE? -- 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. -- 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] Restful authentication and CORS
Albert, when we built our oauth implementation we build it ourselves on top of the python oauth2 lib. it's been a while since we built it so i can't remember if that web2py-oauth2 lib had not been written yet. we also are doing a slightly modified form of auth with our users - they start as anonymous users but still have access tokens, later they register or login with a 3rd party oauth provider and then we are just an oauth client. if that sounds at all like what you are doing maybe i can distill some of what we had into a format that i can share.' christian On 08/05/2014 05:57 AM, Albert Abril wrote: Hi Christian, I'm trying to set up my app as a oauth2 provider too, did you use https://github.com/SamuelMarks/web2py-oauth2 , or another source? do you have any tutorials or documentation about it? I'll appreciate it so much. Cheers, Albert. On 29 May 2013 00:21, Christian Foster Howes cfho...@gmail.com wrote: i have configured my system to be an oauth provider and added a decorator to all RESTful calls to validate the oauth signature. yes, i do this on each request that i require authentication for. On Tuesday, May 28, 2013 6:01:11 AM UTC-7, Ruben D. Orduz wrote: Yes, most REST patterns I've seen are handled either by http basic auth or else request signing. Either option requires handling that on each call. On Tue, May 28, 2013 at 4:54 AM, Michele Comitini michele@gmail.com wrote: REST is stateless so you should not rely on session, hence you can use auth.settings.allow_basic_login = True see here http://web2py.com/books/default/chapter/29/10#Access-Control for proper (as per RFC) authentication challenge with realm use: @auth.basich(basic_auth_real=True|any string) An alternative is to pass an argument or a parameter with authencation info and use auth.login_bare Anyway you must pass authentication info with each call since being the service stateless the server has no way to recognize the client. mic 2013/5/27 Ray (a.k.a. Iceberg) ice...@qq.com Hi Alec, On Tuesday, July 17, 2012 1:03:04 AM UTC+8, Alec Taylor wrote: On Tue, Jul 17, 2012 at 2:20 AM, David Marko dma...@tiscali.cz wrote: +1 from me having this. Btw. On client side i'm using AngularJS and Trigger.io (instead of PhoneGap) I've been looking around, and will have one of the following setups: - *AngularJS http://angularjs.org/* with *BarristerRPC http://barrister.bitmechanic.com/* - *BackboneJS http://backbonejs.org/* with *Backbone.Rpc https://github.com/asciidisco/Backbone.Rpc* - *JQuery mobile* http://jquerymobile.com/ with *jquery-jsonrpc* https://github.com/datagraph/jquery-jsonrpc (or plain JSON.stringify) All within a *PhoneGap http://phonegap.com/* (*Apache Cordova http://incubator.apache.org/cordova/*) app using the* Facebook connect plugin https://github.com/davejohnson/phonegap-plugin-facebook-connect* for authentication (for graceful downgrade from Facebook mobile app https://www.facebook.com/mobile/ to Facebook website auth https://touch.facebook.com). I should have a PoC http://en.wikipedia.org/wiki/Proof_of_Concept on August 2 with a full backend written in web2py and two frontends (one in web2py views; the other in one of the above frameworks). Subsequently I'll release it under a full open-source license onto Bitbucket. I'll post to the web2py list with link + slides when the repo is live Sorry for late response. I am a web2py veteran who dives into restful world only recently. Do you have any finding to share about the restful authentication in web2py? Thanks in advance! Regards, Ray -- --- 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/groups/opt_out. -- --- 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/FyxbO0WGMhU/unsubscribe?hl=en. 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/groups/opt_out. -- --- 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/groups/opt_out. -- 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] Re: IDE for using web2py on windows
Another vote for Pycharm. My approach is a little different from Massimo's, though. I import each class that I use in a function. It can be a lot of boilerplate, but it gives me full use of Pycharm's error detection capability. With the Pycharm project set up in the Web2py folder, I do something like: from gluon.sqlhtml import SQLFORM, ... On Sunday, August 10, 2014 6:30:46 AM UTC-4, Suresh Mali wrote: Am new to web2py looking for better IDE support been using spyder for my other work on windows. Can I continue to use same or need to move to some other IDE? -- 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: Web2py vs ruby on rails for a startup?
My opinions: Size of community is not as important as willingness to provide good, timely help. The Web2py community is second to none in these respects. The Web2py learning curve is such that ... well, if you hire a good Python dev you will soon have a good Web2py dev. I have not found this to be true in, for example, Django. On Sunday, August 10, 2014 2:43:02 AM UTC-4, Suresh Mali wrote: I am trying to zero on web framework for our startup, requirements a. Security ( we are working on financial info hence this is important) b. Good way of accessing algos/data of python Machine learning programs c. Low cost of hosting and development (a strartup with not much funds :-) looking for cloud hosting options. d. Relatively low userbase maybe a 1 million in a year's time (looking to server niche ) After reading a bit have zeroed on Ruby on Rails and Web2Py. Looks like ROR is extremly quick, but might have higher hosting costs.. difficulty of mainitaining etc. other hand web2py seems to pull good things from ROR, but very small community and still early stages.. Please suggest, other suggestion liky Play, django etc. welcome if you feel strongly -- 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: Security advice for updating records
Each user has a unique group with only one member: him. So in your controller, something like def my_great_function(): # Not sure if Web2py session supports get, session.get(auth.user.id, 'nobody') would be more # concise than the next 4 lines of code. if 'auth' in session: # defensive code in case session has timed out user_id = auth.user.id else: return # Session has timed out, most likely. Maybe you want to redirect to login screen # user_id = 'nobody' Alternative if you don't want to redirect group_name = 'user_{}'.format(user_id) if not auth.has_membership(group_name): # whatever you decide to do with failed attempt pass # Your great code here pass On Friday, August 8, 2014 6:03:34 PM UTC-4, desta wrote: Let's assume a table: db.define_table('SecretData', Field('data','string'), Field('file_owner', 'reference auth_user', default=auth. user_id) The table is already populated. On the *View* side, the user is able to send an ajax request which contains the *id*, and some data in order to *update* a record he owns. In this scenario, isn't possible for a user to tamper the *id* variable (i.e. through javascript) and mess up with data from other users? How can I protect against this and enforce the update of the right record? Thank you. -- 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: Restful authentication and CORS
OK. Will look into this asap. On Monday, 16 July 2012 15:43:30 UTC-5, rdodev wrote: Massimo, I believe Alec already has one he linked to: Keep an eye on this issue: http://code.google.com/p/web2py/issues/detail?id=872 so I'm assuming you don't need another one for essentially the same feature request. :) On Monday, July 16, 2012 4:41:11 PM UTC-4, Massimo Di Pierro wrote: Please open a ticket. On Monday, 16 July 2012 13:09:29 UTC-5, rdodev wrote: Massimo, As Alec mentioned above, if not RESTful, OAuth and jsonrpc/jsonp would work as well. So if this is the preferred approach to non-browser/mobile authentication I could definitely work with that. Thanks. On Monday, July 16, 2012 1:59:30 PM UTC-4, Massimo Di Pierro wrote: Can you descrive in some details the API's you would like to have? If there is agreement it would not much to add them. On Monday, 16 July 2012 10:18:55 UTC-5, rdodev wrote: I'm developing a web2py app that will be used as the back-end for a mobile app. The mobile app will be making API calls to the service for anything ranging from login/authentication to CRUD operations. The auth model that comes baked into web2py would suffice, except that it's not RESTful and it's mostly geared to work with a web browser (sessions, cookies, etc.). Is there a way to set the auth module to behave RESTfully? Another issue is that some of the mobile clients might be running on a webView (phoneGap) and thus issuing requests to out back end would result in a same-origin policy denial. Is there a way to setup CORS in web2py (or should we set that up through apache/wsgi instead?) Thanks. -- 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] Problem with saving json string SQLite db via web2py
Dear list, I have a table in SQLlite db where one column is of json type (w2p defined). When I save json string : [ { value:, Param1: 0, Param2: y } { value:, Param1: 1, Param2: n }] via web2py table admin console into this column everything works fine, but if I load csv into SQLite table via admin console (csv import) it returns an errors related to json formatting. Even if I export what I successfully done above with web2py admin console into csv : |{u'value': u'', u'param1': u'0', u'param2': u'y' }|{u'value': u'', u'param1': u'1', u'param2': u'n'} | and try to load it via csv import - nothing works. I understand that there is something wrong with the json formatting, but I cannt get my head over iwhy it works with one approach but not the second. Question: how can I load csv file which has json column in it, into web2py table with json column (SQLite database)? What is the correct json formatting at each step of this procedure? Can you give me a working example Thanks -- 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: Trouble Creating Update Form
The purpose of the app/page is to track progress of a workout routine. It is a 5 week / 35 day schedule. I have all the static information stored in the table (Day, Week, Workout Name), but there are 2 other fields in the table that would need to be updated: rating which is where you rate your performance (1-4) entered via radio buttons, and completed which can be either 0, 1, or 2 (0=complete, 1=current, 2=locked) and is automatically changed to 0 when the form is submitted. I am generating the page by iterating through the records in the table and displaying them (see here for example https://drewhowell.pythonanywhere.com/TwoFiveTracker/default/workouts.html). I realize now that I really only need 1 form, which is for the current day. The user will select a radio button and click submit. It should then update the rating field as well as the completed field. After the form is submitted the page is generated again, but the next day will be the current day with the form. I apologize if that's confusing, but the best way to understand it is looking at the example https://drewhowell.pythonanywhere.com/TwoFiveTracker/default/workouts.html . This is what I'm doing in my workouts.html View: {{for row in rows:}} {{if row.complete == 0:}} // completed day layout {{elif row.complete == 1:}} // current day layout {{=form}} {{else:}} ///locked day layout {{pass}} {{pass}} On Sunday, August 10, 2014 1:27:17 PM UTC-4, Massimo Di Pierro wrote: That's it then. You cannot have multiple forms on the same type on one page unless they refer to different tables. There are other ways but it really depends on what you are trying to do. Can you explain in words what is the page supposed to do. On Sunday, 10 August 2014 11:11:05 UTC-5, Drew Howell wrote: I made the changes and switched to using {{=form}}, but It's still creating a new record. I just realized I didn't post a part of the view that might be causing the issue. I have multiple forms on a single page. ... {{=for row in rows:}} {{=form}} {{pass}} ... Could that be causing the issue? I went ahead and uploaded what I have to Python Anywhere to help illustrate what I'm trying to do. You can check it out here https://drewhowell.pythonanywhere.com/TwoFiveTracker/default/workouts (the layout is slightly broken because of the vertical radio buttons, but that will be fixed next). On Saturday, August 9, 2014 10:33:02 PM UTC-4, Massimo Di Pierro wrote: One problem is that you want to select after you process the form: def workouts(): r = db.workouts(request.args(0)) form = SQLFORM(db.workouts, r).process() if form.accepted: response.flash = 'form accepted' elif form.errors: response.flash = 'form has errors' rows = db(db.workouts).select() return locals() Also instead of using a custom form (unless you really need one), I suggest you do {{=form}} in view and make the fields that you do not need in the form Field(..., readable=False, writable=False) On Saturday, 9 August 2014 20:01:51 UTC-5, Drew Howell wrote: I'm new to Web2Py, so I am creating a (what I thought was a) simple app that tracks progress of a workout routine. I have a database (db.workouts) that has information such as Workout Name, Rating, Completed, etc. I have 2 fields(rating, completed) I would like to update via a form. I have tried a couple different methods, but can't seem to get anything to work correctly. The other fields are already entered in the table and should not be changed. Rating should be updated by a set of radio buttons and Completed should be set to 0 when the form is submitted (0=complete, 1=current, 2=locked). I have created the form, but have done something wrong because, when it is submitted, a new record is created rather than updating the existing one. *Here is my code:* *Model:* db.define_table('workouts', Field('stage'), Field('w', type=integer), Field('workout'), Field('complete', type=integer), Field('d', type=integer), Field('rating', requires=IS_IN_SET([1, 2, 3, 4 ]), widget=SQLFORM.widgets.radio.widget), auth.signature ) *Controller:* def workouts(): rows = db(db.workouts).select() r = db.workouts(request.args(0)) form = SQLFORM(db.workouts, r) if form.process().accepted: response.flash = 'form accepted' elif form.errors: response.flash = 'form has errors' return locals() *View:* ... {{=form.custom.begin}} {{=form.custom.widget.rating}} {{=form.custom.submit}} {{=form.custom.end}} ... As I mentioned earlier, I am new and I may be going about this completely the wrong way. So any help would be greatly appreciated. I can provide more information if
[web2py] Re: Trouble Creating Update Form
I agree that you only seem to need one form. If this is the case there should not be problems. Can you confirm? Massimo On Sunday, 10 August 2014 12:58:06 UTC-5, Drew Howell wrote: The purpose of the app/page is to track progress of a workout routine. It is a 5 week / 35 day schedule. I have all the static information stored in the table (Day, Week, Workout Name), but there are 2 other fields in the table that would need to be updated: rating which is where you rate your performance (1-4) entered via radio buttons, and completed which can be either 0, 1, or 2 (0=complete, 1=current, 2=locked) and is automatically changed to 0 when the form is submitted. I am generating the page by iterating through the records in the table and displaying them (see here for example https://drewhowell.pythonanywhere.com/TwoFiveTracker/default/workouts.html). I realize now that I really only need 1 form, which is for the current day. The user will select a radio button and click submit. It should then update the rating field as well as the completed field. After the form is submitted the page is generated again, but the next day will be the current day with the form. I apologize if that's confusing, but the best way to understand it is looking at the example https://drewhowell.pythonanywhere.com/TwoFiveTracker/default/workouts.html . This is what I'm doing in my workouts.html View: {{for row in rows:}} {{if row.complete == 0:}} // completed day layout {{elif row.complete == 1:}} // current day layout {{=form}} {{else:}} ///locked day layout {{pass}} {{pass}} On Sunday, August 10, 2014 1:27:17 PM UTC-4, Massimo Di Pierro wrote: That's it then. You cannot have multiple forms on the same type on one page unless they refer to different tables. There are other ways but it really depends on what you are trying to do. Can you explain in words what is the page supposed to do. On Sunday, 10 August 2014 11:11:05 UTC-5, Drew Howell wrote: I made the changes and switched to using {{=form}}, but It's still creating a new record. I just realized I didn't post a part of the view that might be causing the issue. I have multiple forms on a single page. ... {{=for row in rows:}} {{=form}} {{pass}} ... Could that be causing the issue? I went ahead and uploaded what I have to Python Anywhere to help illustrate what I'm trying to do. You can check it out here https://drewhowell.pythonanywhere.com/TwoFiveTracker/default/workouts (the layout is slightly broken because of the vertical radio buttons, but that will be fixed next). On Saturday, August 9, 2014 10:33:02 PM UTC-4, Massimo Di Pierro wrote: One problem is that you want to select after you process the form: def workouts(): r = db.workouts(request.args(0)) form = SQLFORM(db.workouts, r).process() if form.accepted: response.flash = 'form accepted' elif form.errors: response.flash = 'form has errors' rows = db(db.workouts).select() return locals() Also instead of using a custom form (unless you really need one), I suggest you do {{=form}} in view and make the fields that you do not need in the form Field(..., readable=False, writable=False) On Saturday, 9 August 2014 20:01:51 UTC-5, Drew Howell wrote: I'm new to Web2Py, so I am creating a (what I thought was a) simple app that tracks progress of a workout routine. I have a database (db.workouts) that has information such as Workout Name, Rating, Completed, etc. I have 2 fields(rating, completed) I would like to update via a form. I have tried a couple different methods, but can't seem to get anything to work correctly. The other fields are already entered in the table and should not be changed. Rating should be updated by a set of radio buttons and Completed should be set to 0 when the form is submitted (0=complete, 1=current, 2=locked). I have created the form, but have done something wrong because, when it is submitted, a new record is created rather than updating the existing one. *Here is my code:* *Model:* db.define_table('workouts', Field('stage'), Field('w', type=integer), Field('workout'), Field('complete', type=integer), Field('d', type=integer), Field('rating', requires=IS_IN_SET([1, 2, 3, 4 ]), widget=SQLFORM.widgets.radio.widget), auth.signature ) *Controller:* def workouts(): rows = db(db.workouts).select() r = db.workouts(request.args(0)) form = SQLFORM(db.workouts, r) if form.process().accepted: response.flash = 'form accepted' elif form.errors: response.flash = 'form has errors' return locals() *View:* ... {{=form.custom.begin}} {{=form.custom.widget.rating}}
[web2py] Re: Problem with saving json string SQLite db via web2py
Interesting. There was a ticket about this and we closed it because we could not reproduce the problem. Which web2py version are you using? Any chance you try the latest? I believe this is fixed but need confirmation. On Sunday, 10 August 2014 12:59:35 UTC-5, Anna Kostikova wrote: Dear list, I have a table in SQLlite db where one column is of json type (w2p defined). When I save json string : [ { value:, Param1: 0, Param2: y } { value:, Param1: 1, Param2: n }] via web2py table admin console into this column everything works fine, but if I load csv into SQLite table via admin console (csv import) it returns an errors related to json formatting. Even if I export what I successfully done above with web2py admin console into csv : |{u'value': u'', u'param1': u'0', u'param2': u'y' }|{u'value': u'', u'param1': u'1', u'param2': u'n'} | and try to load it via csv import - nothing works. I understand that there is something wrong with the json formatting, but I cannt get my head over iwhy it works with one approach but not the second. Question: how can I load csv file which has json column in it, into web2py table with json column (SQLite database)? What is the correct json formatting at each step of this procedure? Can you give me a working example Thanks -- 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: Web2py vs ruby on rails for a startup?
+1 The web2py community is first rate, with plenty of people who help out, and never get tired of helping newbies (like me). Plus, Massimo puts on a mean conference ;-). Looking forward to the next one!! That is spot on about a python developer becoming a good web2py dev quickly. The great thing about web2py is that is in some respects an unobtrusive layer on python - i.e. the framework doesn't get in the way, it is just there when you need it. And learning web2py really means learning how to read good python, and then write good python. Don On Aug 10, 2014, at 14:29, Cliff Kachinske cjk...@gmail.com wrote: My opinions: Size of community is not as important as willingness to provide good, timely help. The Web2py community is second to none in these respects. The Web2py learning curve is such that ... well, if you hire a good Python dev you will soon have a good Web2py dev. I have not found this to be true in, for example, Django. On Sunday, August 10, 2014 2:43:02 AM UTC-4, Suresh Mali wrote: I am trying to zero on web framework for our startup, requirements a. Security ( we are working on financial info hence this is important) b. Good way of accessing algos/data of python Machine learning programs c. Low cost of hosting and development (a strartup with not much funds :-) looking for cloud hosting options. d. Relatively low userbase maybe a 1 million in a year's time (looking to server niche ) After reading a bit have zeroed on Ruby on Rails and Web2Py. Looks like ROR is extremly quick, but might have higher hosting costs.. difficulty of mainitaining etc. other hand web2py seems to pull good things from ROR, but very small community and still early stages.. Please suggest, other suggestion liky Play, django etc. welcome if you feel strongly -- 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. -- 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: Problem with saving json string SQLite db via web2py
I am using 2.9.5. On Sunday, 10 August 2014 22:09:17 UTC+2, Massimo Di Pierro wrote: Interesting. There was a ticket about this and we closed it because we could not reproduce the problem. Which web2py version are you using? Any chance you try the latest? I believe this is fixed but need confirmation. On Sunday, 10 August 2014 12:59:35 UTC-5, Anna Kostikova wrote: Dear list, I have a table in SQLlite db where one column is of json type (w2p defined). When I save json string : [ { value:, Param1: 0, Param2: y } { value:, Param1: 1, Param2: n }] via web2py table admin console into this column everything works fine, but if I load csv into SQLite table via admin console (csv import) it returns an errors related to json formatting. Even if I export what I successfully done above with web2py admin console into csv : |{u'value': u'', u'param1': u'0', u'param2': u'y' }|{u'value': u'', u'param1': u'1', u'param2': u'n'} | and try to load it via csv import - nothing works. I understand that there is something wrong with the json formatting, but I cannt get my head over iwhy it works with one approach but not the second. Question: how can I load csv file which has json column in it, into web2py table with json column (SQLite database)? What is the correct json formatting at each step of this procedure? Can you give me a working example Thanks -- 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: Problem with saving json string SQLite db via web2py
OK. I will look at this asap. On Sunday, 10 August 2014 15:11:54 UTC-5, Anna Kostikova wrote: I am using 2.9.5. On Sunday, 10 August 2014 22:09:17 UTC+2, Massimo Di Pierro wrote: Interesting. There was a ticket about this and we closed it because we could not reproduce the problem. Which web2py version are you using? Any chance you try the latest? I believe this is fixed but need confirmation. On Sunday, 10 August 2014 12:59:35 UTC-5, Anna Kostikova wrote: Dear list, I have a table in SQLlite db where one column is of json type (w2p defined). When I save json string : [ { value:, Param1: 0, Param2: y } { value:, Param1: 1, Param2: n }] via web2py table admin console into this column everything works fine, but if I load csv into SQLite table via admin console (csv import) it returns an errors related to json formatting. Even if I export what I successfully done above with web2py admin console into csv : |{u'value': u'', u'param1': u'0', u'param2': u'y' }|{u'value': u'', u'param1': u'1', u'param2': u'n'} | and try to load it via csv import - nothing works. I understand that there is something wrong with the json formatting, but I cannt get my head over iwhy it works with one approach but not the second. Question: how can I load csv file which has json column in it, into web2py table with json column (SQLite database)? What is the correct json formatting at each step of this procedure? Can you give me a working example Thanks -- 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: Security advice for updating records
Thank you. But still the user is able to tamper data on client side right? On Sunday, August 10, 2014 11:00:47 PM UTC+3, Cliff Kachinske wrote: Each user has a unique group with only one member: him. So in your controller, something like def my_great_function(): # Not sure if Web2py session supports get, session.get(auth.user.id, 'nobody') would be more # concise than the next 4 lines of code. if 'auth' in session: # defensive code in case session has timed out user_id = auth.user.id else: return # Session has timed out, most likely. Maybe you want to redirect to login screen # user_id = 'nobody' Alternative if you don't want to redirect group_name = 'user_{}'.format(user_id) if not auth.has_membership(group_name): # whatever you decide to do with failed attempt pass # Your great code here pass On Friday, August 8, 2014 6:03:34 PM UTC-4, desta wrote: Let's assume a table: db.define_table('SecretData', Field('data','string'), Field('file_owner', 'reference auth_user', default=auth. user_id) The table is already populated. On the *View* side, the user is able to send an ajax request which contains the *id*, and some data in order to *update* a record he owns. In this scenario, isn't possible for a user to tamper the *id* variable (i.e. through javascript) and mess up with data from other users? How can I protect against this and enforce the update of the right record? Thank you. -- 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] Can I create an RSS Reader like Techi in web2py?
On 8/8/14, Gideon George georgegid...@gmail.com wrote: That's really great! I just saw it. initially it was redirecting me to vioos I really like your layout and everything about it. Please I need your help to be able to do something similar to extract political news concerning Nigeria Any tutorial or something? It's my first web2py app I need you to help me on this. I can share the code, if you want. Ricardo -- 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: web2py and anaconda
Don't have a mac, and can't reproduce. However, that's not how you're supposed to run it, I think - you should activate the specific environment you set up for web2py and then let the path select the right python. On Friday, August 8, 2014 9:29:09 AM UTC+3, Massimo Di Pierro wrote: ~/anaconda/bin/python web2py.py -S welcome -P -- 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: MARKMIN italics not working with didn't
Thanks guys. Going to trunk now :) On Sunday, August 10, 2014 10:30:37 PM UTC+8, Leonel Câmara wrote: I think changing markmin regex_em from ''(?Pt[^\s']+(?: +[^\s']+)*)'' to ''(?Pt([^\s']| |'(?!'))+)'' would solve this. -- 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: Security advice for updating records
On the client side who cares? On Sunday, August 10, 2014 5:38:31 PM UTC-4, desta wrote: Thank you. But still the user is able to tamper data on client side right? On Sunday, August 10, 2014 11:00:47 PM UTC+3, Cliff Kachinske wrote: Each user has a unique group with only one member: him. So in your controller, something like def my_great_function(): # Not sure if Web2py session supports get, session.get(auth.user.id, 'nobody') would be more # concise than the next 4 lines of code. if 'auth' in session: # defensive code in case session has timed out user_id = auth.user.id else: return # Session has timed out, most likely. Maybe you want to redirect to login screen # user_id = 'nobody' Alternative if you don't want to redirect group_name = 'user_{}'.format(user_id) if not auth.has_membership(group_name): # whatever you decide to do with failed attempt pass # Your great code here pass On Friday, August 8, 2014 6:03:34 PM UTC-4, desta wrote: Let's assume a table: db.define_table('SecretData', Field('data','string'), Field('file_owner', 'reference auth_user', default=auth. user_id) The table is already populated. On the *View* side, the user is able to send an ajax request which contains the *id*, and some data in order to *update* a record he owns. In this scenario, isn't possible for a user to tamper the *id* variable (i.e. through javascript) and mess up with data from other users? How can I protect against this and enforce the update of the right record? Thank you. -- 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] Can I create an RSS Reader like Techi in web2py?
WOW! That's really great to hear. I don't even know how to start appreciating right now. I am really grateful for that, Absolutely grateful! I will love to learn and implement it. it's gonna help me alot. Thank you very much and I pray that God grant you all your heart desires, Amen. It's my very first web2py app and I am really learning and excited. I want to be one of the best in Africa, and I am on my way...I just can't wait to start! -- 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: Trouble Creating Update Form
It's still creating a new record rather than updating. So I've still got something wrong. I need to look over the code and see if I can find anything that sticks out. On Sunday, August 10, 2014 4:07:57 PM UTC-4, Massimo Di Pierro wrote: I agree that you only seem to need one form. If this is the case there should not be problems. Can you confirm? Massimo On Sunday, 10 August 2014 12:58:06 UTC-5, Drew Howell wrote: The purpose of the app/page is to track progress of a workout routine. It is a 5 week / 35 day schedule. I have all the static information stored in the table (Day, Week, Workout Name), but there are 2 other fields in the table that would need to be updated: rating which is where you rate your performance (1-4) entered via radio buttons, and completed which can be either 0, 1, or 2 (0=complete, 1=current, 2=locked) and is automatically changed to 0 when the form is submitted. I am generating the page by iterating through the records in the table and displaying them (see here for example https://drewhowell.pythonanywhere.com/TwoFiveTracker/default/workouts.html). I realize now that I really only need 1 form, which is for the current day. The user will select a radio button and click submit. It should then update the rating field as well as the completed field. After the form is submitted the page is generated again, but the next day will be the current day with the form. I apologize if that's confusing, but the best way to understand it is looking at the example https://drewhowell.pythonanywhere.com/TwoFiveTracker/default/workouts.html . This is what I'm doing in my workouts.html View: {{for row in rows:}} {{if row.complete == 0:}} // completed day layout {{elif row.complete == 1:}} // current day layout {{=form}} {{else:}} ///locked day layout {{pass}} {{pass}} On Sunday, August 10, 2014 1:27:17 PM UTC-4, Massimo Di Pierro wrote: That's it then. You cannot have multiple forms on the same type on one page unless they refer to different tables. There are other ways but it really depends on what you are trying to do. Can you explain in words what is the page supposed to do. On Sunday, 10 August 2014 11:11:05 UTC-5, Drew Howell wrote: I made the changes and switched to using {{=form}}, but It's still creating a new record. I just realized I didn't post a part of the view that might be causing the issue. I have multiple forms on a single page. ... {{=for row in rows:}} {{=form}} {{pass}} ... Could that be causing the issue? I went ahead and uploaded what I have to Python Anywhere to help illustrate what I'm trying to do. You can check it out here https://drewhowell.pythonanywhere.com/TwoFiveTracker/default/workouts (the layout is slightly broken because of the vertical radio buttons, but that will be fixed next). On Saturday, August 9, 2014 10:33:02 PM UTC-4, Massimo Di Pierro wrote: One problem is that you want to select after you process the form: def workouts(): r = db.workouts(request.args(0)) form = SQLFORM(db.workouts, r).process() if form.accepted: response.flash = 'form accepted' elif form.errors: response.flash = 'form has errors' rows = db(db.workouts).select() return locals() Also instead of using a custom form (unless you really need one), I suggest you do {{=form}} in view and make the fields that you do not need in the form Field(..., readable=False, writable=False) On Saturday, 9 August 2014 20:01:51 UTC-5, Drew Howell wrote: I'm new to Web2Py, so I am creating a (what I thought was a) simple app that tracks progress of a workout routine. I have a database (db.workouts) that has information such as Workout Name, Rating, Completed, etc. I have 2 fields(rating, completed) I would like to update via a form. I have tried a couple different methods, but can't seem to get anything to work correctly. The other fields are already entered in the table and should not be changed. Rating should be updated by a set of radio buttons and Completed should be set to 0 when the form is submitted (0=complete, 1=current, 2=locked). I have created the form, but have done something wrong because, when it is submitted, a new record is created rather than updating the existing one. *Here is my code:* *Model:* db.define_table('workouts', Field('stage'), Field('w', type=integer), Field('workout'), Field('complete', type=integer), Field('d', type=integer), Field('rating', requires=IS_IN_SET([1, 2, 3, 4 ]), widget=SQLFORM.widgets.radio.widget), auth.signature ) *Controller:* def workouts(): rows = db(db.workouts).select() r = db.workouts(request.args(0)) form = SQLFORM(db.workouts, r) if
[web2py] Please help me clear this error! long() argument must be a string or a number, not 'Table'
I have to copy the error ticket and paste it here, please help me. It's been killing me for days! I can't write a post and post it to the database of the form crud.create(db.table) All the tutorials I follow used it perfectly but I have never used it successfully. What is happening? type 'exceptions.TypeError' long() argument must be a string or a number, not 'Table'Versionweb2py™Version 2.9.5-stable+timestamp.2014.03.16.02.35.39 PythonPython 2.7.5+: /usr/local/bin/uwsgi (prefix: /usr)Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. Traceback (most recent call last): File /home/GideonG/web2py/Gidigba/gluon/restricted.py, line 220, in restricted exec ccode in environment File /home/GideonG/web2py/Gidigba/applications/Gidigba/controllers/default.py https://www.gidigba.ng/admin/edit/Gidigba/controllers/default.py, line 230, in module File /home/GideonG/web2py/Gidigba/gluon/globals.py, line 385, in lambda self._caller = lambda f: f() File /home/GideonG/web2py/Gidigba/applications/Gidigba/controllers/default.py https://www.gidigba.ng/admin/edit/Gidigba/controllers/default.py, line 194, in timeline if form.accepts(request): File /home/GideonG/web2py/Gidigba/gluon/sqlhtml.py, line 1592, in accepts self.vars.id = self.table.insert(**fields) File /home/GideonG/web2py/Gidigba/gluon/dal.py, line 9114, in insert ret = self._db._adapter.insert(self, self._listify(fields)) File /home/GideonG/web2py/Gidigba/gluon/dal.py, line 1353, in insert query = self._insert(table,fields) File /home/GideonG/web2py/Gidigba/gluon/dal.py, line 1344, in _insert values = ','.join(self.expand(v, f.type) for f, v in fields) File /home/GideonG/web2py/Gidigba/gluon/dal.py, line 1344, in genexpr values = ','.join(self.expand(v, f.type) for f, v in fields) File /home/GideonG/web2py/Gidigba/gluon/dal.py, line 1552, in expand return str(self.represent(expression,field_type)) File /home/GideonG/web2py/Gidigba/gluon/dal.py, line 2014, in represent return str(long(obj)) TypeError: long() argument must be a string or a number, not 'Table' Error snapshot [image: help] https://www.gidigba.ng/admin/default/ticket/Gidigba/41.203.69.5.2014-08-11.00-24-47.07c4862d-35e4-41e3-842c-4bd7c01f5921# type 'exceptions.TypeError'(long() argument must be a string or a number, not 'Table') inspect attributes Frames - *File /home/GideonG/web2py/Gidigba/gluon/restricted.py in restricted at line 220* code arguments variables - *File /home/GideonG/web2py/Gidigba/applications/Gidigba/controllers/default.py in module at line 230* code arguments variables - *File /home/GideonG/web2py/Gidigba/gluon/globals.py in lambda at line 385* code arguments variables - *File /home/GideonG/web2py/Gidigba/applications/Gidigba/controllers/default.py in timeline at line 194* code arguments variables - *File /home/GideonG/web2py/Gidigba/gluon/sqlhtml.py in accepts at line 1592* code arguments variables - *File /home/GideonG/web2py/Gidigba/gluon/dal.py in insert at line 9114* code arguments variables - *File /home/GideonG/web2py/Gidigba/gluon/dal.py in insert at line 1353* code arguments variables - *File /home/GideonG/web2py/Gidigba/gluon/dal.py in _insert at line 1344* code arguments variables - *File /home/GideonG/web2py/Gidigba/gluon/dal.py in genexpr at line 1344* code arguments variables - *File /home/GideonG/web2py/Gidigba/gluon/dal.py in expand at line 1552* code arguments variables - *File /home/GideonG/web2py/Gidigba/gluon/dal.py in represent at line 2014* code arguments variables Function argument list (self=gluon.dal.MySQLAdapter object, obj=Table auth_user (id,first_name,last_name,email,..._government,city_of_resident,image,phone_number), fieldtype='reference auth_user') Code listing 2009. 2010. 2011. 2012. 2013. 2014. 2015. 2016. 2017. 2018. return str(obj) elif field_is_type('reference'): # reference # check for tablename first referenced = fieldtype[9:].strip() if referenced in self.db.tables: return str(long(obj)) p = referenced.partition('.') if p[2] != '': try: ftype = self.db[p[0]][p[2]].type -- 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
Re: [web2py] Re: bootstrap 3 - if you care help test trunk now
Would you send me this as a patch? I too would prefer to default to NO col-lg-* On Sunday, 10 August 2014 17:25:51 UTC-5, Ricardo Pedroso wrote: On 8/10/14, Massimo Di Pierro massimo.dipie...@gmail.com wrote: https://github.com/web2py/web2py/archive/master.zip note, you have to use formstyle. For auth forms this is now set by default in db.py. form = SQLFORM(..., formstyle = SQLFORM.formstyles.bootstrap3) I only test SQLFORM. I don't like to see the col-lg-'s hardcoded in the bootstrap3 formstyle I've attached a small app with two bootstrap3 formstyles. One is for horizontal forms and the other is for vertical forms It's more close to what I would like to have in web2py. Just unzip in web2py/applications folder. It will create an app named bs3 Then: http://localhost:8000/bs3 Ricardo -- 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.