[web2py] URL rewrite

2014-08-14 Thread Manuele Pesenti
Hi! I need to use one of my web2py application as a reverse proxy to browse some web pages served by other systems. Google-ing for it I found this[1] old documentation page who says: " web2py supports URL rerwite although this is not really recommended. You should really use Apache (or lighttpd) +

[web2py] scripts/cpdb.py is Python 2.7 only

2014-08-14 Thread Stefan Scholl
scripts/cpdb.py uses modules that are only available with Python 2.7 and syntax that isn't available in Python 2.5 Are the scripts an exception to the pledge for backward compatibility? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

Re: [web2py] web2py grid select all filtred rows

2014-08-14 Thread Manuele Pesenti
Il 13/08/14 21:29, keiser1080 ha scritto: > so on the controler i can get the rows by doing grid.rows? yes > The query is also stored on an accessible grid proprety ? I don't know. The code of the function that defines the grid is not so easy to read but you can try to look into it: https://github.

[web2py] Re: sheduler task not running

2014-08-14 Thread peter
I changed the task to use a flag in a file rather than a flag in the database, this seems to stop the worker from hanging. So it would seem that one is well advised to avoid using SQLite within the scheduler unless one has WAL. Actually a way that might be safe is to use another database for

[web2py] Re: URL rewrite

2014-08-14 Thread Manuele Pesenti
Il 14/08/14 10:01, Manuele Pesenti ha scritto: > Are there other reason why I have not to do it or can I follow this way? Another question... is it still a right way even if I need a dynamic proxy based on some configuration I have to retrieve from db? M. -- Resources: - http://web2py.com -

[web2py] Re: scripts/cpdb.py is Python 2.7 only

2014-08-14 Thread Anthony
Are you saying the cpdb.py script used to work under Python 2.5 but was changed and now works only under Python 2.7? Note, backward compatibility means that an older app will continue to work when you upgrade web2py. It does not mean that an app running on a particular OS, web server, data stor

[web2py] Re: scripts/cpdb.py is Python 2.7 only

2014-08-14 Thread Leonel Câmara
Why are you still using 2.5 anyway? If it depended on me web2py wouldn't even support 2.6. There are a lot of features that 2.6 is missing that improve performance and web2py can't use. Python 2.7 was released more than 4 years ago... -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Planning to use Web2py CAS as Authnication service for Tornado

2014-08-14 Thread Phyo Arkar
In our new application , it will be interactive Chat + Social Media/News/Forum discussion. For most interactive part it will be done in Tornado , but for Non Interactive parts (Registration , Auth) I am going to use Web2py. Database will be Mongodb. We've used web2py extensively for past 5 years.

[web2py] Re: sheduler task not running

2014-08-14 Thread Niphlod
taken directly from the book. *The first argument of the Scheduler class must be the database to be used by the scheduler to communicate with the workers. This can be the db of the app or another dedicated db, perhaps one shared by multiple apps. If you use SQLite it's recommended to use a sepa

[web2py] CSS issue with embedded form

2014-08-14 Thread Joe
I am just learning web2py and I love it!!! I am experimenting with it so I can learn it. THE QUESTION: I use my own HTML and CSS. I embedded a form in the HTML like so" {{=form}} The form is displayed fine and works perfectly, however, it just floath left no matter what I do in the page. I pla

[web2py] search db, return table with pagination

2014-08-14 Thread Anna Kostikova
Dear list, I am trying to create a search form to access a table in database and then return a table of result into a view (same page), but displaying only 3 records and next/prev buttons to scroll over results (e.g. I want to have pagination of the table display results). I am trying to follow

[web2py] Re: scripts/cpdb.py is Python 2.7 only

2014-08-14 Thread Massimo Di Pierro
web2py is supposed to work with python 2.5 - 2.7. Scripts can be an exception but they really shoudn't. Can you provide a patch? On Thursday, 14 August 2014 07:57:58 UTC-5, Leonel Câmara wrote: > > Why are you still using 2.5 anyway? If it depended on me web2py wouldn't > even support 2.6. There

[web2py] Re: Planning to use Web2py CAS as Authnication service for Tornado

2014-08-14 Thread Massimo Di Pierro
Did you see this: https://github.com/web2py/web2py/blob/master/gluon/contrib/websocket_messaging.py On Thursday, 14 August 2014 09:18:41 UTC-5, Phyo Arkar wrote: > > In our new application , it will be interactive Chat + Social > Media/News/Forum discussion. > For most interactive part it will b

[web2py] Re: Hypermedia API and Collection+JSON in web2py

2014-08-14 Thread Massimo Di Pierro
I think if you require the dal from the equation, there is almost no overlap any more with web2py. On Wednesday, 13 August 2014 16:32:46 UTC-5, Cliff Kachinske wrote: > > Massimo, > > The new recipe you propose is "bottle+dal+validators+auth+collection" > > Could it be "bottle++validators+auth+co

[web2py] translate AJAX null type into NoneType

2014-08-14 Thread Júlia Rizza
Hello, When I save something on a page, it sends an AJAX with all the info I need to record in the database. It seems much like this: {type: "cover", title: "test", description: null, tags: null} But the null types, when received by the controller, become string types. I need them to become

[web2py] Python upgrade

2014-08-14 Thread Richard
Good evening, I did upgrade python from 2.7.4 to 2.7.8. on my development laptop and encounter a 'basic' issue. In a controller I call create_mgt_sys(form_add_entity.vars.id, com) Which is defined as: def create_mgt_sys(id_new_entity, com): .. Now web2py/python come

[web2py] Re: scripts/cpdb.py is Python 2.7 only

2014-08-14 Thread Leonel Câmara
Well argparse can be installed in 2.5 that one is easy, we could include a version and import it from our version if it isn't there. However cpdb also uses a lot of advanced string formatting which 2.5 doesn't have (the .format calls), it can't be imported from future in 2.5, and it would be a

[web2py] Re: float usage; 2 decimals

2014-08-14 Thread Stefan van den Eertwegh
Is there anyone who knows why this is happening? Please, anyone? Op vrijdag 11 juli 2014 11:50:30 UTC+2 schreef Stefan van den Eertwegh: > > Hi, > > I have a float type in the define tables and when he inserts 3.50 into the > database he makes 4.0 off it. > How comes that it rounds off the float

[web2py] Re: Python upgrade

2014-08-14 Thread dlypka
Maybe just try rebooting you machine. On Thursday, August 14, 2014 10:44:21 AM UTC-7, Richard wrote: > > Good evening, > > I did upgrade python from 2.7.4 to 2.7.8. on my development laptop and > encounter a 'basic' issue. > > In a controller I call > > create_mgt_sys(form_add_entity.vars.

[web2py] Re: float usage; 2 decimals

2014-08-14 Thread Oli
please show your model, comtroller and view Am Freitag, 11. Juli 2014 11:50:30 UTC+2 schrieb Stefan van den Eertwegh: > > Hi, > > I have a float type in the define tables and when he inserts 3.50 into the > database he makes 4.0 off it. > How comes that it rounds off the float? And not uses the u

[web2py] Re: Python upgrade

2014-08-14 Thread Richard
I did reboot, and recompiled the app. No success. On Thursday, August 14, 2014 9:03:44 PM UTC+2, dlypka wrote: > > Maybe just try rebooting you machine. > > On Thursday, August 14, 2014 10:44:21 AM UTC-7, Richard wrote: >> >> Good evening, >> >> I did upgrade python from 2.7.4 to 2.7.8. on my dev

[web2py] Re: CSS issue with embedded form

2014-08-14 Thread Cliff Kachinske
That's kind of an inappropriate use of the h2 tag for starters. Why not put it inside a tag set and style fake-h2 however you like. On Wednesday, August 13, 2014 11:30:27 PM UTC-4, Joe wrote: > > I am just learning web2py and I love it!!! > > I am experimenting with it so I can learn it. > > TH

[web2py] Re: float usage; 2 decimals

2014-08-14 Thread Cliff Kachinske
What database? Web2py has a decimal datatype which, in my use cases, mimics the Python decimal datatype. I use Postgresql and the adapter turns Python decimal into Postgres numeric. Both of these types act like real world decimal numbers. In other words, .2 + .1 comes out to .3. Of course a di

[web2py] Re: sheduler task not running

2014-08-14 Thread peter
> > Sorry I overlooked that. >> > Overall I have to say that I have found the scheduler implimentation excellent. It is very versatile and well thought out. So many thanks for all your hard work on this and to anyone else who contributed. Peter -- Resources: - http://web2py.com - http://web

[web2py] Re: Python upgrade

2014-08-14 Thread Richard
The decorator on the function is causing the error: def log_usage(function): if db(db.community).select(): def inner(*args, **kwargs): db.im_usage.insert(function_name=function.func_name) db.commit() return function() return inner else:

Re: [web2py] Re: duplicate ids on using auth.login and auth.register forms on same page

2014-08-14 Thread Mark Li
Was this problem addressed, or is there are workaround for this? I am currently trying to implement something very similar, where both auth.login() and auth.register() forms are on the same page. Currently, they produce duplicate ID's (ex. both login and register password inputs have the id of

[web2py] Re: Python upgrade

2014-08-14 Thread Leonel Câmara
It should be: def log_usage(function): if db(db.community).select(): def inner(*args, **kwargs): db.im_usage.insert(function_name=function.func_name) db.commit() return function(*args, **kwargs) return inner else: return False -

[web2py] Re: Strange ajax problem

2014-08-14 Thread Michael Beller
Thanks Cliff and Niphlod, I've used ajax several times and think I understand the process. My problem now involves using a form inside a bootstrap modal and using ajax to submit the form. What I meant by "web2py intercepting" the event was that web2py.js registers an event handler for the sub

[web2py] Web2py + AngularJS: routes

2014-08-14 Thread Najtsirk
Hello, i have problem with Web2py and AngularJS regarding routes. Where should be partial .html files of specific routes stored? In static folder? Best, Kristjan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https:

[web2py] Re: plugin_lazy_options widget

2014-08-14 Thread Jesse Ferguson
OK so I could never figure out how to use this widget on itself, I ruptured a few brain cells in the process and just decided to learn jquery. In case anyone is ever in my position here is my working solution 1)scrap the second lazy_options_widget and just use the default web2py select box.

[web2py] Re: Strange ajax problem

2014-08-14 Thread Limedrop
You might want to check out the javascript that Leonel submitted here: https://groups.google.com/d/msg/web2py/JFy3BCHXgYc/7npKiqs6BOUJ In particular see how he uses: $.web2py.disableElement(form.find($.web2py.formInputClickSelector)); On Friday, August 15, 2014 8:20:05 AM UTC+12, Michael Be

[web2py] Re: Strange ajax problem

2014-08-14 Thread Cliff Kachinske
Aha, I get what you're doing now. Maybe the simple answer is don't use a submit button. Try something like You may have to mess around with the css a bit to get the vertical alignment and height right. This will work around the client side handlers. On Thursday, August 14, 2014 4:20:05 PM

[web2py] How to show just entered value in the same form after self-submitting?

2014-08-14 Thread Dragan Matic
I have a form with two fields, one field is a selection box of previously typed values and the other is a text box. User can choose a value from a selection box or can type a value in text box and submit it in which case I would like to add a value to a selection box, something like this: # so

[web2py] How to differentiate logic for auth.login() and auth.register() forms on the same page?

2014-08-14 Thread Mark Li
I am currently using auth.login() and auth.register() forms on the same page I would like to use the following code for the login (to allow users to sign up with either username or email) auth.settings.login_userfield = 'email' if request.vars.email and IS_EMAIL()(request.vars.email)[1]: aut

Re: [web2py] translate AJAX null type into NoneType

2014-08-14 Thread Vinicius Assef
It depends on how you are receiving the data in your controller. Remember all http requests transfer string data. So, it's up to your controller making appropriate conversions and validations according to your expectations. Maybe a Web2py FORM helps you. On Thu, Aug 14, 2014 at 2:18 PM, Júlia

[web2py] Re: How to differentiate logic for auth.login() and auth.register() forms on the same page?

2014-08-14 Thread Leonel Câmara
You need to differentiate them using the form name. Something like: if request.post_vars._formname == 'login': # do my login stuff -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/is

[web2py] Re: Web2py vs ruby on rails for a startup?

2014-08-14 Thread Joe Barnhart
I would disagree with RoR being extremely quick. I inherited a commercial site using RoR and I'm completely replacing it in web2py. One reason is because of its long pauses while users are trying to get their tasks done. RoR was quick when the site was small, but now that its grown it is bog

[web2py] Re: web2py and anaconda

2014-08-14 Thread Joe Barnhart
My Google-fu turned up two answers http://stackoverflow.com/questions/7124035/in-python-shell-b-letter-does-not-work-what-the http://ubuntuforums.org/showthread.php?t=1963764 My anaconda installation does it too. Have not fixed the .pythonrc yet. -- Joe On Thursday, August 7, 2014 11:29:09

[web2py] Re: Web2py + AngularJS: routes

2014-08-14 Thread dlypka
in the Views folders as usual. But then I also had to make controller functions for each .html. For example: def jqplot(): # This method is necessary to allow views/home/jqplot.html to be rendered response.delimiters = ('{[',']}') return dict() On Thursday, August 14, 2014 3:41

[web2py] Re: Strange ajax problem

2014-08-14 Thread Michael Beller
Thanks Limedrop and Cliff, I found something that appears to work but I don't understand why. I re-read the web2py book and noticed in: http://www.web2py.com/books/default/chapter/29/11/jquery-and-ajax#Ajax-form-submission that the following line was added at the end of the submit handling fun

Re: [web2py] Can I create an RSS Reader like Techi in web2py?

2014-08-14 Thread Gideon George
Oh Ok, that will be great! I can't wait... Wish you the best of the best. Thank you On Wed, Aug 13, 2014 at 11:28 PM, Ricardo Pedroso wrote: > Next weekend I can share the code. I have to cleanning it a little bit. > > Ricardo > > > On 8/11/14, Gideon George wrote: > > > >> > >> WOW! That's re

[web2py] Re: search db, return table with pagination

2014-08-14 Thread Anna Kostikova
I have also tried to the information from here - https://web2py.wordpress.com/category/web2py-and-tables/ but it also didn't work with the same error "NoneType' object is not iterable" On Wednesday, 13 August 2014 22:14:46 UTC+2, Anna Kostikova wrote: > > Dear list, > > I am trying to create a s

[web2py] Re: PeerQuiz

2014-08-14 Thread eric cuver
ok. I just need to know how I can build PeerQuiz form in answer section with the + and - thank you in advance Le mardi 5 août 2014 17:57:55 UTC+2, Massimo Di Pierro a écrit : > > It is not open source. > > On Sunday, 3 August 2014 12:29:42 UTC-5, eric cuver wrote: >> >> hello , >> >> everybod

[web2py] Re: CSS issue with embedded form

2014-08-14 Thread Joe
Thank for the reply. The h2 tags are inside an existing class so they should react like all the other h2 tags in that class and they do to some extend as far as color and size but not the position. In any case, I created a new div for the form and added a margin to push it to the middle but th

[web2py] Re: Strange ajax problem

2014-08-14 Thread Leonel Câmara
In a jquery event handler returning false is the same as calling event.preventDefault and event.stopPropagation that's why you don't get the Working... anymore, you are stopping web2py.js handlers for submission from being processed. Namely this one: $(doc).on('submit', 'form', function (

[web2py] Re: How to differentiate logic for auth.login() and auth.register() forms on the same page?

2014-08-14 Thread Mark Li
Yep that did it, thanks Leonel! On Thursday, August 14, 2014 4:55:45 PM UTC-7, Leonel Câmara wrote: > > You need to differentiate them using the form name. > > Something like: > > if request.post_vars._formname == 'login': ># do my login stuff > -- Resources: - http://web2py.com - http://we

[web2py] Re: Strange ajax problem

2014-08-14 Thread Michael Beller
Thanks Leonel - awesome explanation. I looked through your code that you posted to load forms in modals and handle file uploads - I need to study more. One question - you say below "you're using web2py's ajax convenience function which doesn't care about what it's doing" - I'm actually not usi

[web2py] Re: scripts/cpdb.py is Python 2.7 only

2014-08-14 Thread Massimo Di Pierro
OK I rewrote it but I really want to know who wrote that in the first place. Needs testing. On Thursday, 14 August 2014 12:52:20 UTC-5, Leonel Câmara wrote: > > Well argparse can be installed in 2.5 that one is easy, we could include a > version and import it from our version if it isn't there. >

[web2py] Re: Strange ajax problem

2014-08-14 Thread Leonel Câmara
Using your jquery post code or web2py's ajax functiong would give you the same problem with the button that you're preventing with return false. Basically, if you want you can just remove return false from your submit handler and add this to your javascript: $(document).on('ajax:complete', '#my

[web2py] Re: scripts/cpdb.py is Python 2.7 only

2014-08-14 Thread Anthony
On Thursday, August 14, 2014 10:41:14 PM UTC-4, Massimo Di Pierro wrote: > > OK I rewrote it but I really want to know who wrote that in the first > place. > Apparently, Mart . -- Resources: - http://we

[web2py] Re: scripts/cpdb.py is Python 2.7 only

2014-08-14 Thread Leonel Câmara
Eheheh I commend your effort on this one Massimo, I wouldn't have touched it with a 10 foot pole. -- 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 rec

[web2py] Plugin providing a Location picker widget for geometry fields

2014-08-14 Thread Leonel Câmara
In 12 hours or so I'm going on a week long vacation, before I go, I thought this could be useful to some people here, even if just as an example, now that the DAL supports geo stuff. This small plugin provides a location picker and a validator for geometry (NOT geography) fields that actually r

[web2py] Re: Strange ajax problem

2014-08-14 Thread Michael Beller
Thanks Leonel, I tried both options but couldn't get them to work - or at least I haven't found the right combination. I also created a simple ajax form using the example in the book to apply your two recommendations. I could only get it to work with the 'return false' statement but that woul

[web2py] Re: search db, return table with pagination

2014-08-14 Thread Andriy
Thats because your "rows = None" until you submit the form. You can add this check in the template: *{{if rows:}}* {{for i,row in enumerate(rows):}} ... ... next {{pass}} *{{pass}}* Or you can try set rows to empty list in controller: def search(): *rows = []* -- Resources: - http://web2py

[web2py] How to change css for reference tables

2014-08-14 Thread LoveWeb2py
Hello, Following this example: >>> db.define_table('person', Field('name'), format='%(name)s') >>> db.define_table('thing', Field('name'), Field('owner_id', 'reference person'), format='%(name)s')