Re: [web2py] Re: Web2Py on lighthttpd fastcgi - The definitive answer.

2010-08-25 Thread François Delpierre
YES ! This did it. There is just a typo about the path to web2py. After testing all parameters separately, I found that my problem was comming from the missing line : include_shell "/usr/share/lighttpd/create-mime.assign.pl" Thanks a lot ! Regards, On Wed, Aug 25, 2010 at 10:50 PM, mdipierro

[web2py] How can I create a file in an upload field, and add lines to it ?

2012-04-14 Thread François Delpierre
Hi, I have a table with two upload fields. I need to transform the file from the first upload field, and create it in the second upload field. What is the best way to do it, and possibly avoid to first create the file in memory before writing it to the disk. It looks like I can generate the ran

[web2py] Re: How can I create a file in an upload field, and add lines to it ?

2012-04-14 Thread François Delpierre
v file.') Le samedi 14 avril 2012 12:51:36 UTC+2, François Delpierre a écrit : > > Hi, > > I have a table with two upload fields. I need to transform the file from > the first upload field, and create it in the second upload field. > What is the best way to do it, and p

[web2py] Re: filename in dal

2012-04-26 Thread François Delpierre
Thanks for the tip. But I do not understand the default behavior of Web2Py. I would expect to have the original file name displayed, instead of just the link named "file". In order to achieve this, I take your previous typ and I adapt my DAL : db.mytable.f_sourcefile.represent = lambda rowid,ro

[web2py] How to compute Field on update based on previous value.

2012-05-01 Thread François Delpierre
Hi, Here is exactly what I would like to have, but it does not compute on update : db.define_table('t_templates', Field('f_template', type='upload', label=T('File'),notnull=True), Field('f_revision', ty

[web2py] Re: How to compute Field on update based on previous value.

2012-05-01 Thread François Delpierre
I have no error message, but I suspect the row to not be populated with the ['f_revision'] field. Le mardi 1 mai 2012 13:31:43 UTC+2, François Delpierre a écrit : > > Hi, > > Here is exactly what I would like to have, but it does not compute on > update : > &g

Re: [web2py] How to compute Field on update based on previous value.

2012-05-01 Thread François Delpierre
Thanks Khalil, I did a try but it did not work, in fact the form.vars.t_revision does not exists. 1. Could it be because I'm using SQLFORM.grid ? 2. I was aware that we can paste a list to onvalidation, but never a dict ( onvalidation={'onsuccess':mycustom} ), is this in the docs ? I would have

[web2py] Re: How to compute Field on update based on previous value.

2012-05-01 Thread François Delpierre
compute=lambda: db.t_templates(request.vars.id).f_revision + 1 if > (request.vars.id and > request.vars._formname and request.vars_formname.startswith( > 't_templates')) else 1)) > > Anthony > > On Tuesday, May 1, 2012 7:31:43 AM UTC-4, François Delpierre wrote: >>

[web2py] [Solved] How to compute Field on update based on previous value.

2012-05-01 Thread François Delpierre
So both solutions are working. One on the form in the controller, one as compute in the models when defining the table. Thanks, Le mardi 1 mai 2012 21:38:59 UTC+2, François Delpierre a écrit : > > Hi Anthony, > > The proposal does not work as is. It looks like there is >

[web2py] ProgrammingError: Cannot operate on a closed database. in generator

2012-05-04 Thread François Delpierre
Hi, Here is my problem. It looks like the databases closes while in my Generator. I also tried to pass the DB with the send() function as described in an other post. In a web page, I have an iframe that calls a function that returns a generator to get some kind of "asynchronous" update in the

[web2py] Re: ProgrammingError: Cannot operate on a closed database. in generator

2012-05-04 Thread François Delpierre
nerator() : for i in xrange(20): time.sleep(0.2) outline = 'My Name is : \n' yield outline time.sleep(0.2) yield outline time.sleep(0.2) mygen = createGenerator() return mygen Le vendredi 4

[web2py] SQLFORM.smartgrid : error when setting fields to be displayed as a fields dictionary.

2012-05-09 Thread François Delpierre
Hi, When I try to select the fields to be displayed as follow : form = SQLFORM.smartgrid( db.t_xlsfile, fields=dict( t_xlsfile=[ db.t_xlsfile.f_xlsfile, ], ), I immediately get this strange error :

[web2py] Re: SQLFORM.smartgrid : error when setting fields to be displayed as a fields dictionary.

2012-05-10 Thread François Delpierre
fields=[ > db.t_xlsfile.f_xlsfile, > ], > ), > > do you get the same error. Can you try web2py trunk as well? > > > On Wednesday, 9 May 2012 19:08:31 UTC-5, François Delpierre wrote: >> >> Hi, >> >> When

[web2py] No error_message displayed when using IS_LIST_OF(IS_ALPHANUMERIC()) validator

2012-05-11 Thread François Delpierre
Hi, I have no error message when I wrongly fill a list with spaces / special characters. However the validator works, as I need to respect it to update the record. db.define_table('parameter', Field('allowed_users', type='list:string'), ) db.parameter.allowed_users.requires = IS_LIST_OF(

[web2py] Re: SQLFORM.smartgrid : error when setting fields to be displayed as a fields dictionary.

2012-05-11 Thread François Delpierre
Sorry Massimo, I didn't found any Bug Reporting Tool on the web2py web site or on the presentation message of this list. Where can I report the bug ? Thanks, Le jeudi 10 mai 2012 02:08:31 UTC+2, François Delpierre a écrit : > > Hi, > > When I try to select the fields to be di

[web2py] [Fixed] SQLFORM.smartgrid : error when setting fields to be displayed as a fields dictionary.

2012-05-11 Thread François Delpierre
Le jeudi 10 mai 2012 02:08:31 UTC+2, François Delpierre a écrit : > > Hi, > > When I try to select the fields to be displayed as follow : > form = SQLFORM.smartgrid( > db.t_xlsfile, > fields=dict( >

[web2py] How to get the selected menu / active menu ?

2012-05-19 Thread François Delpierre
Hi, Here is my solution : If my response.menu is somthing like : response.menu = [('Menu1', False), ('Menu2', True), ('Menu3', False)] I can use this in my view to display the active menu : {{=[x[0] for x in response.menu if x[1]==True][0]}} It's working well, but is there no better and more e

[web2py] Re: How to get the selected menu / active menu ?

2012-05-19 Thread François Delpierre
Anyway thanks, I'll keep my workaround. Regards, Le samedi 19 mai 2012 14:22:23 UTC+2, François Delpierre a écrit : > > Hi, > > Here is my solution : > If my response.menu is somthing like : > > response.menu = [('Menu1', False), ('Menu2', True), ('Me

[web2py] Re: How to get the selected menu / active menu ?

2012-05-19 Thread François Delpierre
Thanks Niphlod, Yes, it's more 'tune my code' is it's perfectly working, and it keeps very fast. The problem with the javascript version is that I want to have the Translated name of the menu not just the link. My previous version is buggy when you're not logged in. So, I had to adapt : {{

[web2py] How to prevent delete of a row with SQLFORM.grid -

2012-05-20 Thread François Delpierre
I must ensure there is always at least one row in a table. (My application parameter table) How can I prohibit delete of the last row of a table ? As it looks the ondelete is executed AFTER deletion... Thanks,

[Solved] [web2py] How to prevent delete of a row with SQLFORM.grid -

2012-05-22 Thread François Delpierre
> > Excellent idea Johann, You're totally right, I was not looking into this approach. Here is the working code : def manage_parameters(): # Make sure user cannot delete the last parameter set. (row) if db(db.para

[web2py] Re: How to prevent delete of a row with SQLFORM.grid -

2012-05-23 Thread François Delpierre
... working but I have a side effect : It looks like the "Delete" on a row is just removing the row from the screen, without full refresh of the page. So, the last line is always "deletable", but in fact it does not deletes.

[web2py] Invalid Circual Reference - misleading error message

2012-06-02 Thread François Delpierre
Hi, I'm getting (again) stuck with an "Invalid Circual Reference" using Wizard. Finally, it looks like I have been able to fix it by just changing the order of the table in my wizard, so the table order counts in the wizard. We must have listed first all the tables to which we want to refer in

[web2py] App does not exist or your are not authorized when deploying layout plugin

2012-06-02 Thread François Delpierre
I just created a simple plugin as described here (Only the view/layout.html and a CSS) : http://comments.gmane.org/gmane.comp.python.web2py/71183 Here is the content of the w2p plugin file : pivert@skinner:~/Downloads$ tar -ztvf web2py.plugin.layout_name.w2p -rw-rw francoisd/www-data 6279 201

Re: [web2py] App does not exist or your are not authorized when deploying layout plugin

2012-06-26 Thread François Delpierre
No, it's not a permission problem. It seems to happen when I include the view/layout.html file in the w2p file by issuing the tar command manually as described by Massimo. Here is the command I use : tar zcvf ../web2py.plugins.name_layout.w2p views/layout.html views/plugin_layout_name/* static/p

[web2py] Re: App does not exist or your are not authorized when deploying layout plugin

2012-06-26 Thread François Delpierre
Ok, so it means that the solution from Massimo is not working anymore : http://permalink.gmane.org/gmane.comp.python.web2py/71241 How can I then make plugins that automatically change the layout of the application without having to leave web interface ? That's strange, as one of the downloadable

[web2py] Re: App does not exist or your are not authorized when deploying layout plugin

2012-06-27 Thread François Delpierre
Then I do not understand why when I deploy web2py.plugin.layout_Compromise.w2p from the web interface it overwrites the view/layout.html file! pivert@skinner:~/Downloads/web2py/applications/Incident_report_2$ ls -lh views/layout.html -rw-r--r-- 1 pivert pivert 6.2K Jun 26 23:49 views/layout.ht

[web2py] Invalid circual reference

2012-07-04 Thread François Delpierre
Hi, I'm getting an invalid circual reference very often with the wizard. It's seems very buggy. Most of the time, this is because I refer to a table that is later in my definition list. Changing the order fixes this problem. But sometimes, I have no idea. I already lost a lot of time with this

[web2py] Re: Invalid circual reference

2012-07-05 Thread François Delpierre
I'll have a look to build the steps to reproduce the problem, however I wonder if the problem could not occur when I change the name (and type) of the first field of a table, that is 'name' by default.

[web2py] SQLFORM.smartgrid: TSV & CSV export with hidden cols only shows visible cols

2013-01-23 Thread François Delpierre
When using the CSV export with hidden cols or the TSV export with hidden cols, I have none of the hidden columns in the view. Here is the SQLFORM being used: def index(): form = SQLFORM.smartgrid( db.t_bsc, onupdate=auth.archive, linked_tables=['t_bsc', 't_device

[web2py] Re: How do I use web2py to make a simple GUI?

2013-01-23 Thread François Delpierre
Hi Kaare, I'm not sure I fully understand your need. But, if all you need is a simple web app to make a calculation from some fields and get one or more answers, Web2Py is probably the right tool for doing it. One of your wish is to have this app correctly displaying on your mobile phone browse

[web2py] Re: SQLFORM.smartgrid: TSV & CSV export with hidden cols only shows visible cols

2013-01-24 Thread François Delpierre
Thanks Alan, Just tried the nightly build, and it's not (yet) fixed. Regards, --

[web2py] websocket_messaging.py over ssl

2013-01-24 Thread François Delpierre
websocket_messaging.py looks nice, and the example in the comments immediately works in chrome. (not in ff) But how can I encapsulate that in https or using it through ssl? Regards, --

[web2py] How can I disable the delete confirmation in SQLFORM.grid ?

2013-01-29 Thread François Delpierre
-- --- 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.

[web2py] Cannot label id field

2013-02-09 Thread François Delpierre
Hi, Let's see the definition: db.define_table('t_bsc', Field('id', type='integer', label=T('Service Code')), Field('f_name', type='string', label=T('Service name'), comment=T('The name of the customer facing service as known to your customer.')), But in my smartgrid,

[web2py] Re: How can I disable the delete confirmation in SQLFORM.grid ?

2013-02-09 Thread François Delpierre
Ok, so it's not included in the grid options. changing it in web2py.js would disable the confirmation globally, that's a bit dangerous for other tables. I would prefer to do it only for 1 particular table. Or maybe creating a web2py_noconfirm.js included in a layout_noconfirm.html ? -- ---

[web2py] Re: Unique Constraint not working for : Field(type='upload', unique=True)

2013-02-09 Thread François Delpierre
Hi, I got a quite similar result by working on the validation at the form level: if form1.process().accepted: session.flash = 'File uploaded' redirect(URL('check_xls_file', args=form1.vars.id, user_signature= True)) elif form1.errors: response.flash = 'File rejecte

[web2py] Most Missing features in Web2Py

2013-03-01 Thread François Delpierre
I'm using Web2Py for 6 months now, and I'm very happy with it.But here are the most missing features I found in Web2Py. Most of those missing features concerns grids/smartgrids. - inline_editing parameter for SQLFORM.(smart)grid to allow inline edition of some or all fields (ajax), withou

[web2py] How to order by IP address? Or how to write an orderby function?

2013-03-04 Thread François Delpierre
Hi, How can I orderby IP address? Can I write my own sort function? How? The following code: db.t_device2ip.f_ip_id.requires = IS_IN_DB(db,'t_ip.id','%(f_ip_addr)s: %(f_dns_name)s',multiple=False, orderby = 't_ip.f_ip_addr') Sort as if IP was a string. (well in fact it is.. but that's not the r

[web2py] Re: How can I disable the delete confirmation in SQLFORM.grid ?

2013-03-04 Thread François Delpierre
Yes Anthony, I think such an option is missing, as usually you just want to disable that for few grids... -- --- 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

Re: [web2py] Re: Cannot label id field

2013-03-04 Thread François Delpierre
Field('name', 'string',length=50, requires=IS_NOT_EMPTY()), >>... >> Field('country','string',length=3), >> Field('active','boolean'),format='%(name)s', singular='customer'

[web2py] How to select(count<1, groupby=db.person) or how to find persons with no dogs/less than x dogs.

2012-12-13 Thread François Delpierre
So, for instance : db().select(db.person.name, db.person.id.count(), groupby=db.person.id, left=db.dog.on(db.person.id==db.dog.person_id)) will give me the person, and the number of dogs that this person has. But I only want to get persons with no dogs. Regards, --

[web2py] Re: How to select(count<1, groupby=db.person) or how to find persons with no dogs/less than x dogs.

2012-12-14 Thread François Delpierre
Excellent !! That did it. Thanks a lot. It would be very nice to have a wiki with all the samples for the DAL. I did found this one : http://web2py.wordpress.com/2010/05/23/some-tricks-to-use-when-dealing-with-databases/ but it didn't help me. I was not thinking about the negation. Thanks, --

[web2py] Small typos in latest documentation.

2013-01-01 Thread François Delpierre
http://web2py.com/books/default/chapter/29/07#The-process-and-validate-methods Typo in the list. http://web2py.com/books/default/chapter/29/04 scheduler.queur_task( --

[web2py] Unique Constraint not working for : Field(type='upload', unique=True)

2013-01-02 Thread François Delpierre
Hi, The unique constraint is not working in the following Field definition. Field('f_xlsfile', type='upload', notnull=True, requires=[ IS_UPLOAD_FILENAME(extension='^xlsx?$', error_message='Please post .xls or .xlsx Excel files only.'),

[web2py] Best way to migrate from sqlite to postgresql (or other db)

2013-10-11 Thread François Delpierre
Hi, For performance reason I would like to migrate my DB from sqlite to postgreSQL DB. What's the best way to do it. I spent some time with the export / db.import_from_csv_file(open('somefile.csv', 'rb')) and I just feel like I'm loosing my time for 2 hours. After trying to fix various problems

[web2py] (foreign key constraint failed) with onupdate=auth.archive

2015-02-05 Thread François Delpierre
Hi, I get an Integrity Error everytime I modify a record in the t_route, and I don't understand what's wrong. The t_route contains only 1 record, the t_route_archive is empty. What should I do? The controller: @auth.requires_login() def route_manage(): form = SQLFORM.smartgrid(db.t_route,

[web2py] How to copy and move a file from the admin interface?

2015-02-18 Thread François Delpierre
Hi, >From the admin interface, it's easy to create a new file or to delete it, but how do I move one to an other folder, or just copy an existing one to a new file name? This is one of the few operation I still need a shell on the server for. Regards, -- Resources: - http://web2py.com - http

[web2py] Get Ticket issued: unknown instead of the reference link to the error ticket when crashing

2015-05-11 Thread François Delpierre
Hi, On a Debian 7, with web2py 2.9.12-stable+timestamp.2015.02.13.23.31.09 (Running on Apache, Python 2.7.3) - WSGI with https I have a problem I can't figure out. On a healthy instance of Web2PY, when an error occurs, we have an "Internal Error" message, and a Ticket Issued with a link pointi