[web2py] Re: optimising isempty()

2014-05-19 Thread Massimo Di Pierro
Yes. try... except... should not contain database queries because if the db raises an exception you cannot ignore it, you need to rollback. On Monday, 19 May 2014 02:45:13 UTC-5, at...@xouom.com wrote: > > Hi > > I would like to propose the following edit to isempty() in gluon.dal as I > believe

[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)

2014-05-19 Thread Massimo Di Pierro
If you open a python shell can you do >>> import pymongo does it work? If python can find it web2py can find it, unless you have two python versions installed. On Sunday, 18 May 2014 12:58:22 UTC-5, Cynthia Butler wrote: > > By the way I tried installing pymongo two ways: > > 1) easy_install

Re: [web2py] Re: Is there an Easier way to store uploads in the DB (postgres) ?

2014-05-19 Thread Mandar Vaze / मंदार वझे
> On Mon, May 19, 2014 at 11:43 PM, Anthony wrote: > >> Try: >> >> db._adapter.uploads_in_blob = True >> >> Then, when you do: >> >> db.define_table('mytable', Field('myfile', 'upload', uploadfield=True)) >> >> you should get a blob field called db.mytable.myfile_blob with the >> readable and writ

[web2py] Unable to pass arguments to a LOAD for a modal dialog

2014-05-19 Thread Sarbjit
Hi, I am using the plugin for modal dialog from "http://dev.s-cubism.com/plugin_dialog";. I am somehow not able to pass arguments to modal dialog box. *Controller :-* def index(): dialog1 = DIALOG(LOAD(f='inner',ajax=True), title='Test',vars={'a':'testvar'},close_button='Close', rendersty

Re: [web2py] Re: Is there an Easier way to store uploads in the DB (postgres) ?

2014-05-19 Thread Mandar Vaze / मंदार वझे
On Mon, May 19, 2014 at 11:43 PM, Anthony wrote: > Try: > > db._adapter.uploads_in_blob = True > > Then, when you do: > > db.define_table('mytable', Field('myfile', 'upload', uploadfield=True)) > > you should get a blob field called db.mytable.myfile_blob with the > readable and writable attribut

Re: [web2py] Re: Menu for anonymous and logged

2014-05-19 Thread Fabiano Almeida
Cool Anthony! Thanks!!! Fabiano. 2014-05-19 20:43 GMT-03:00 Anthony : > Sure: > > if auth.user: > [custom menu or append/insert into standard menu] > > if auth.has_membership('some_group'): > [same idea here] > > Anthony > > > On Monday, May 19, 2014 6:29:42 PM UTC-4, Fabiano Almeida w

Re: [web2py] web2py conference - online talks

2014-05-19 Thread joseph simpson
Yes, I had these types of problems also... An offline solution would be great. Have fun, Joe On Mon, May 19, 2014 at 4:43 PM, Ricardo Cárdenas < ricardo.carde...@gmail.com> wrote: > Kudos to everyone involved in the web2py conference! > > I'm having trouble watching the videos - maybe it's my

Re: [web2py] web2py conference - online talks

2014-05-19 Thread Ricardo Cárdenas
Kudos to everyone involved in the web2py conference! I'm having trouble watching the videos - maybe it's my connection, but often the video stops and the pointer resets to the beginning of the video. I'm having to refresh the browser and start over. I don't know if others are having these probl

[web2py] Re: Menu for anonymous and logged

2014-05-19 Thread Anthony
Sure: if auth.user: [custom menu or append/insert into standard menu] if auth.has_membership('some_group'): [same idea here] Anthony On Monday, May 19, 2014 6:29:42 PM UTC-4, Fabiano Almeida wrote: > > Hi all! > > It's possible make differ menu for groups or logged users in > "models/m

[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)

2014-05-19 Thread Cynthia Butler
By the way I tried installing pymongo two ways: 1) easy_install which put the pymongo .so files in my home/cindy/ folder which I assumed web2py couldn't find (since web2py is in home/www-data/ ). So I uninstalled that. 2) sudo pip which put all the unzipped pymongo files in the /usr/local/l

[web2py] optimising isempty()

2014-05-19 Thread atan
Hi I would like to propose the following edit to isempty() in gluon.dal as I believe this would improve performance particularly for tables with numerous fields: def isempty(self): try: return not self.select('id', limitby=(0, 1), orderby_on_limitby= False) except

[web2py] Accessing records

2014-05-19 Thread Tom Russell
Hi, I have some records in my db that I need to access to get them and perform some calculations on. My code to access the records is: rows = db(db.voltrin.id > 0).count() currentrow = rows - 4 for x in range(currentrow, rows): record = db.voltrin(db.voltrin.id==x)

[web2py] Menu for anonymous and logged

2014-05-19 Thread Fabiano Almeida
Hi all! It's possible make differ menu for groups or logged users in "models/menu.py" ? How? Thanks, Fabiano. -- 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 Issue

[web2py] Re: pymongo is installed but I get this error: no driver available ('pymongo',)

2014-05-19 Thread Cynthia Butler
I restarted the nginx webserver and got the internal web2py python shell working again. Still don't know how to get web2py to find pymongo. Any hints? On Saturday, May 17, 2014 7:43:51 PM UTC-6, Cynthia Butler wrote: > > I am trying to use MongoDB 2.6.1 and pymongo 2.7 with the DAL on my local >

[web2py] Including custom javascript in web2py

2014-05-19 Thread niki
hi, I have been trying to understand how i can include static JavaScript files on my view layout.html I want to embed an editor on web2py. I have an html code which works out fine on its own: However i would like this code to work in web2py as well. I have tried using 'response.files.append(URL(

[web2py] Web2py grid pagination class set

2014-05-19 Thread Stefan van den Eertwegh
Hi al, I have a grid in web2py and want a pagination class define to use the bootstrap pagination styling. The parameters pagination_class and paginator_class doesnt work. Does anyone know how this works? Thank you! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] datetime smart query

2014-05-19 Thread Manuele Pesenti
Hi, can somebody help me to build up smart queries that involve datetime fields? How format I have to use for the datetime I want use as comparison value? than you very mutch cheers Manuele -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2p

[web2py] Re: Application Licensing

2014-05-19 Thread 'sasogeek' via web2py-users
I found this resource that gives a nice list of benefits of going Open Source which is great! But I'm also a little concerned about monetization. I'm a student and I've spent a lot of time with this project

[web2py] Re: Application Licensing

2014-05-19 Thread 'sasogeek' via web2py-users
I haven't considered OS, not that I'm against it. But hypothetically speaking since I'm still in considerations,what are the benefits of going open source? On Monday, 19 May 2014 19:20:37 UTC, Niphlod wrote: > > consider that also any third party library (either python or js, css, etc) > could

[web2py] Re: Application Licensing

2014-05-19 Thread Niphlod
consider that also any third party library (either python or js, css, etc) could have its own license model. Also, you should choose beforehand if you want to release it as an open source project or not. On Monday, May 19, 2014 2:09:32 PM UTC+2, sasogeek wrote: > > That actually is my question.

[web2py] Re: Important New Year News: PyCon 2014 Tutorial

2014-05-19 Thread Ykä Marjanen
Here's the link to the video from pyvideo.org: http://pyvideo.org/video/2558/0-to-0000-with-web2py I think it's a good introductory video for newbies to get some insights, but I think Massimo's videos are better for actually learning the framework :) Ykä On Saturday, January 4, 2014 6:03:

[web2py] Re: Is there an Easier way to store uploads in the DB (postgres) ?

2014-05-19 Thread Anthony
Try: db._adapter.uploads_in_blob = True Then, when you do: db.define_table('mytable', Field('myfile', 'upload', uploadfield=True)) you should get a blob field called db.mytable.myfile_blob with the readable and writable attributes set to False. Also, feel free to submit a Google Code issue re

[web2py] Is there an Easier way to store uploads in the DB (postgres) ?

2014-05-19 Thread Mandar Vaze
Currently I am using "uploadfield" option of "Field"/table definition to ensure that uploads are stored in DB and not on the filesystem. While this works, this seems tedious because : 1. I have multiple tables with upload fields. If I forget defining "uploadfield" even one of them (or if someon

[web2py] Re: question about video

2014-05-19 Thread villas
Not sure whether this is the problem, but a quick run through HTML Tidy highlighted a few issues with the markup. Maybe correct those first. "Warning", "2","Untitled","Untitled","16","29","0"," discarding newline in URI reference" "Warning", "1","Untitled","Untitled","8","25","0","adjacent hyp

[web2py] Re: multiple views same controller

2014-05-19 Thread Anthony
In a model file, maybe something like: response.view = '%s/%s' % (request.env.http_host.rpartition('.')[-1],response .view) Which should yield paths like com/default/index.html, de/default/index.html, etc. Anthony On Monday, May 19, 2014 8:27:57 AM UTC-4, ctrlSoft wrote: > > Hi, what is the be

[web2py] multiple views same controller

2014-05-19 Thread ctrlSoft
Hi, what is the best way to make multiple views for the same controller. i have an application with multiple domains .com .de .it co.uk for every domain the controllers, models is the same but in views i have to make some changes it's different for every domain for static files i used routes, but

[web2py] Re: Application Licensing

2014-05-19 Thread 'sasogeek' via web2py-users
That actually is my question. I don't know which license I like. I'm new to licenses, but with the little knowledge I have about softwares and applications, I know I need one. Not sure what my options are, and especially with the fact that I want to have a renewable one that's purchasable perio

[web2py] Re: Application Licensing

2014-05-19 Thread Anthony
As the book states: release your applications which use official web2py libraries under any > license you wish > You can license your app however you'd like. Anthony On Monday, May 19, 2014 6:53:05 AM UTC-4, sasogeek wrote: > > How do I license a web2py application for commercial use? I'd like

[web2py] Re: chinging text of the "submit" button and creating a button without a form

2014-05-19 Thread Multiplery
And is there a way to make a button which leads to a page by click, similar to this: form=FORM('Your name:', INPUT(_type='submit')) form.add_button('click me', URL('index')) Am Sonntag, 18. Mai 2014 13:07:16 UTC+2 schrieb Multiplery: > > Hey, > i have two quest

[web2py] Re: creating a row3 where the rows are in row1 but not in row2

2014-05-19 Thread Lucas Schreiber
Thank you very much, Anthony. Your code almost works, it needed just a minor correction: owned_licenses = dba(dba.owned_license.owner_id == owner_id)._select(dba. owned_license.license_id, distinct=True) unowned_licenses = dba(~dba.license.license_id.belongs(owned_licenses)). select() Then it wo

[web2py] Application Licensing

2014-05-19 Thread 'sasogeek' via web2py-users
How do I license a web2py application for commercial use? I'd like to have a license that's renewable every 6 months. From a few similar questions I've read, I've gathered that web2py does allow commercial distribution but must be stated in the documentation that the application uses web2py...