Re: [web2py] SQLForm.grid custom details page

2012-07-29 Thread Johann Spies
On 30 July 2012 05:13, SeamusSeamus wrote: > > I only want the "title", "price", "photo", "description" and maybe "date" > to show in the details.html, and not ALL of the fields in the DB (contains > private information) > > In your function 'details' set the fields that you do now want to be dis

[web2py] Book typo

2012-07-29 Thread Johann Spies
I suppose res.updated in the documentation for *validate_and_insert, validate_and_update* in the book should be ret.updated Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) --

[web2py] Re: Question about Human-readable forms + REST CRUD APIs.

2012-07-29 Thread Anthony
> > - if you define your models carefully with requires parameters > (validators) in web2py, the SQLFORM object will use them, and you can > trigger the use of those validators via your REST API (i forget the exact > call, but there is something that does validation and insert/update in the >

[web2py] Re: Facing problem of settingup web2py project in Eclipse.

2012-07-29 Thread Amit
Does anyone having any idea how to resolve those incorrect errors in eclipse? problem: I set up web2py project in eclipse and having one project inside applications folder but when i opened any file of project all import statement are showing in Red underline saying "Unresolved import" for e.g.

[web2py] Re: SQLFORM.factory in a model -- huge performance degradation with db size [closed]

2012-07-29 Thread weheh
Actually, the form is not displayed on every request and is embedded in a function. When I have the time, I will be moving it to modules, not a controller. I am basically using the automatic form generation capabilities of web2py without the self-submitting capabilities. I override all the form

[web2py] SQLForm.grid custom details page

2012-07-29 Thread SeamusSeamus
Hi, I am creating a basic app that allows users to view item in an inventory. They are able to see the item list by using the sqlform.grid. Because some fields in the database are private and I do not want the viewer to see it, I am unable to use the default details page. Because of this, I n

[web2py] Re: how to increase field value without to affect computed fields

2012-07-29 Thread Massimo Di Pierro
have you tried? db.table.updated_on.update=None # disable it db(query).update(counter=db.table.counter+1) On Sunday, 29 July 2012 17:28:35 UTC-5, Vasile Ermicioi wrote: > > hi, > > I have a table with computed fields, and also field with update values > (e.g updated_on) > I want to increase a

Re: [web2py] Re: InterfaceError

2012-07-29 Thread Massimo Di Pierro
This thread was opened by Necati who reports to be using 1.77 and we cannot support something so old. I assume you are having the same problem. Can you tell us more about your code so that we can reproduce the problem? This is usually due a non-thread safe use of the db object. For example you

[web2py] Re: Question about Human-readable forms + REST CRUD APIs.

2012-07-29 Thread howesc
i'll add a couple of comments: - if you define your models carefully with requires parameters (validators) in web2py, the SQLFORM object will use them, and you can trigger the use of those validators via your REST API (i forget the exact call, but there is something that does validation and in

[web2py] Re: SQLFORM.factory in a model -- huge performance degradation with db size [closed]

2012-07-29 Thread howesc
i might also ask if that form is displayed on *every* request. if not, i would recommend moving it from the model file to the controller where it is used (or a module if it is used in several controllers). On Sunday, July 29, 2012 7:25:55 AM UTC-7, weheh wrote: > > Massimo, thanks for pointing

[web2py] how to increase field value without to affect computed fields

2012-07-29 Thread Vasile Ermicioi
hi, I have a table with computed fields, and also field with update values (e.g updated_on) I want to increase a field count (number of views) each time an item is displayed but without touching other fields how to do that without raw sql? --

[web2py] Running SSH commands and capturing the results (Threading)

2012-07-29 Thread Tito Garrido
Hi Folks! I'd like to create a web application that will basically send a command to 1000 servers and grab some data using subprocess + ssh like: *p = sub.Popen(['ssh','-q', 'support@%s'%hostname, command],stdout=sub.PIPE, stderr=sub.STDOUT) out = p.stdout.read() print out # it will be a

[web2py] Link stats through rerouting URL (geoip)

2012-07-29 Thread BlueShadow
Hi, I like to get information about usage of a link to an outside page. To track some advertizing progress^^. So My idea was to use a URL to my web2pyapplication which redirects to the URL I want to get stats about. I would like to record the day and the number of clicks as well as the region(ge

Re: [web2py] Re: InterfaceError

2012-07-29 Thread Elton Pereira
I'm using version 2.0.0 Elton Pereira On Sun, Jul 29, 2012 at 4:39 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > The version of web2py that you are running is more than 2 years old. You > need to upgrade to the latest stable before we can help you. The problem > may have been solve

[web2py] Re: is it possible to run web2py parallel to php on apache port 80?

2012-07-29 Thread Don_X
I have succeeded in doing this on my home ubuntu server by using the info on the same link Massimo provided ! ... & not too long ago ... I have tried to do the same thing on a windows 7 ( with the real apache server installed with openssl ) .. it did not go as smoothly .. on windows 7 .. it d

[web2py] Re: Question regarding plugin multiselect ( as a widget ) on a form ...

2012-07-29 Thread Don_X
Thank you Massimo .. I am trying it ( with the last multiselect plugin version 1.8 ) .. and will update this post with what I got ! ... --

Re: [web2py] Re: InterfaceError

2012-07-29 Thread Massimo Di Pierro
The version of web2py that you are running is more than 2 years old. You need to upgrade to the latest stable before we can help you. The problem may have been solved long ago. Massimo On Sunday, 29 July 2012 14:23:18 UTC-5, Elton Pereira de Lima wrote: > > There solution to this problem? > I'm

Re: [web2py] Re: Best way to secure insert on remote call?

2012-07-29 Thread Alec Taylor
Actually I've just been fiddling around with this and run into a few problems. Would you be able to show me a more complete example? Thanks, Alec Taylor On Sun, Jul 29, 2012 at 12:28 PM, Alec Taylor wrote: > Thanks, that should do the trick > > > On Sun, Jul 29, 2012 at 12:38 AM, Massimo Di Pi

Re: [web2py] Re: InterfaceError

2012-07-29 Thread Elton Pereira de Lima
There solution to this problem? I'm experiencing the same problem and I find no solution, what is the cause? Tanks! Em domingo, 2 de maio de 2010 19h25min42s UTC-3, mdipierro escreveu: > > Can you show the complete model and controller? If you want you can > email it to me confidentially. > > M

[web2py] Re: is it possible to run web2py parallel to php on apache port 80?

2012-07-29 Thread Massimo Di Pierro
Yes but I have not done it. My understanding is that you can use a configuration such as described here: https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-ubuntu.sh#L80 and within the same virtualhost you map some paths to the php folder php_admin_value open_basedir "

[web2py] is it possible to run web2py parallel to php on apache port 80?

2012-07-29 Thread Robin Manoli
Hey, I'm wondering if it is possible to run web2py on the same port as other php-websites run. I have a normally configured LAMP, and I can install the required apache mod. Then the question is if a web2py app can run parallel, just as different php/html sites do with different domain names, usi

[web2py] Re: Eclipse and autocomplete

2012-07-29 Thread voyager29
To get eclipse/PyDev to autocomplete web2py code, after some quick trial and error here is what worked for me: Assuming: the top level eclipse project dir is web2py your_app is the name of your application inside the web2py/applications folder: In __init__.py of your_app folder: if 0: from

[web2py] Re: Question regarding plugin multiselect ( as a widget ) on a form ...

2012-07-29 Thread Massimo Di Pierro
Your question is the same as this one: http://stackoverflow.com/questions/6459974/how-to-add-option-using-multiselect-jquery-plugin The answer you want is the first one. I do not have a complete example of integration with web2py. Give it a try and if, necessary, I will take a second look. Any

Re: [web2py] Installing Levenshtein module in controller

2012-07-29 Thread Jonathan Lundell
On 29 Jul 2012, at 11:05 AM, praveen krishna wrote: > Oh,I haven't done this is this the mistake I have done? but is this > applicable for web2py as well .If so we have run this command in web2py > terminal? No, it has nothing in particular to do with web2py. It's a Python thing. Some modules

Re: [web2py] Installing Levenshtein module in controller

2012-07-29 Thread praveen krishna
Oh,I haven't done this is this the mistake I have done? but is this applicable for web2py as well .If so we have run this command in web2py terminal? On Sun, Jul 29, 2012 at 7:59 PM, Jonathan Lundell wrote: > On 29 Jul 2012, at 10:56 AM, praveen krishna > wrote: > > What do u mean by building a m

Re: [web2py] Installing Levenshtein module in controller

2012-07-29 Thread Jonathan Lundell
On 29 Jul 2012, at 10:56 AM, praveen krishna wrote: > What do u mean by building a module.I don't know how to built a module I just > extracted the folder and stored it in applications/yourapp/modules and tried > to import it. Levenshtein is written in C, and must be compiled before it can be i

Re: [web2py] Installing Levenshtein module in controller

2012-07-29 Thread praveen krishna
What do u mean by building a module.I don't know how to built a module I just extracted the folder and stored it in applications/yourapp/modules and tried to import it. On Sun, Jul 29, 2012 at 7:52 PM, Jonathan Lundell wrote: > On 29 Jul 2012, at 10:22 AM, praveen krishna > wrote: > > How to

Re: [web2py] Installing Levenshtein module in controller

2012-07-29 Thread Jonathan Lundell
On 29 Jul 2012, at 10:22 AM, praveen krishna wrote: > How to import the Levenshtein in controller of web2py actullaĆ½ I have > downloaded the tar.bz2 folder of levenstein from > http://code.google.com/p/pylevenshtein/ extracted in web2py/site-packages and > used the command import Levenshtei

[web2py] Question regarding plugin multiselect ( as a widget ) on a form ...

2012-07-29 Thread Don_X
Hello web2py users ... This is a question in 2 folds : I wish to use the multiselect plugin as a widget on a form ( SQLFORM ) as opposed to on a crud as demonstrated in the following example : http://www.web2py.com/plugins/default/multiselect However there is one additional detail that I wish

[web2py] Re: Is Vars Bad for SEO?

2012-07-29 Thread pbreit
Can you give us some examples of your before and after URLs? In general it shouldn't be a big impact because there are so many variables to SEO. It's usually best to construct URLs as makes the most sense for your web site. Then you can think about SEO. --

[web2py] Installing Levenshtein module in controller

2012-07-29 Thread praveen krishna
Hi, How to import the Levenshtein in controller of web2py actullaĆ½ I have downloaded the tar.bz2 folder of levenstein from http://code.google.com/p/pylevenshtein/ extracted in web2py/site-packages and used the command import Levenshtein but it dosen't work and even I tried by extracting in

[web2py] Re: running scheduler as a windows service or background process

2012-07-29 Thread Massimo Di Pierro
I am thinking it would also be nice to have checkboxes to start the scheduler from the tkinter widget. On Saturday, 28 July 2012 02:35:43 UTC-5, Tim Richardson wrote: > > > > On Saturday, 28 July 2012 17:26:17 UTC+10, Massimo Di Pierro wrote: >> >> Something like this should be included in web2py

Re: [web2py] Re: Import SCV Button

2012-07-29 Thread Massimo Di Pierro
My bad. db[form.vars.table].import_from_csv_file(request.vars.csvfile) should be db[form.vars.table].import_from_csv_file(request.vars.csvfile.file) On Sunday, 29 July 2012 10:32:29 UTC-5, Alec Taylor wrote: > > On Mon, Jul 30, 2012 at 12:11 AM, Massimo Di Pierro < > massimo.dipie...@gmail.com>

[web2py] Re: Centos 5 script for Nginx with Uwsgi and Web2py

2012-07-29 Thread Massimo Di Pierro
In trunk. Kept the previous name. Added Peter's full name. On Sunday, 29 July 2012 09:26:37 UTC-5, Alan Etkin wrote: > > The fixed peter scrip to install Python 2.7.3 and self-signed certs for > ssl enabled apps. It retrieves the base architecture also for nginx > installation. It should be test

Re: [web2py] Re: Import SCV Button

2012-07-29 Thread Alec Taylor
On Mon, Jul 30, 2012 at 12:11 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Sorry. My advice was about downloading all tabes at once. > > If you want import one table you could do: > > def import_table(): > form = SQLFORM.factory(Field('table',requires=IS_IN_SET(db.tables)), > >

[web2py] Re: Centos 5 script for Nginx with Uwsgi and Web2py

2012-07-29 Thread Alan Etkin
The fixed peter scrip to install Python 2.7.3 and self-signed certs for ssl enabled apps. It retrieves the base architecture also for nginx installation. It should be tested although, as I only used its commands separately. -- #!/bin/bash # Script for installing Web2py with Nginx and Uwsgi

[web2py] Re: SQLFORM.factory in a model -- huge performance degradation with db size [closed]

2012-07-29 Thread weheh
Massimo, thanks for pointing out the obvious to me. I knew it had to be something that simple, just couldn't see it. I had decided to use factory instead of pure SQLFORM because I'm not going through the usual self-submit process. The db is all manipulated via ajax in this case and the form is a

Re: [web2py] Re: Import SCV Button

2012-07-29 Thread Massimo Di Pierro
Sorry. My advice was about downloading all tabes at once. If you want import one table you could do: def import_table(): form = SQLFORM.factory(Field('table',requires=IS_IN_SET(db.tables)), Field('csvfile','upload',uploadfield=False)) form.proce

[web2py] Re: is_impersonating() as boolean in menu

2012-07-29 Thread Massimo Di Pierro
I think this should be considered a bug. Than you check trunk? On Sunday, 29 July 2012 05:37:51 UTC-5, weheh wrote: > > I haven't traced through all the code carefully, but is_impersonating() > returns current.session.auth.impersonator, which is based on a cPickle. So > you're not getting a boo

[web2py] Re: SQLFORM.factory in a model -- huge performance degradation with db size

2012-07-29 Thread Massimo Di Pierro
P.S. An even better approach would be to remove the dropdown ...requires=[IS_NULL_OR(IS_IN_DB(db, 'auth_user.id'))] # note [..] and use an autocomplete widget to allow to search for users. auth.settings.extra_fields['auth_user']=[Field('fullname',readable=False,writable=False,compute=lambda

[web2py] Re: SQLFORM.factory in a model -- huge performance degradation with db size

2012-07-29 Thread Massimo Di Pierro
First of all form = SQLFORM.factory(db.mytable, record=db.mytable[myindex]) should probably be form = SQLFORM(db.mytable, record=db.mytable[myindex]) Anyway. The slow down is due to the IS_IN_DB(db, 'auth_user.id') validator. Every time you display the form, it will create a new dropdow

Re: [web2py] Re: Import SCV Button

2012-07-29 Thread hasan alnator
Thank you a lot massimo but what is tempfile and how can i give it a certain table to import ?? Best Regards, On Sun, Jul 29, 2012 at 5:14 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > In view: > download all > > In controller > > def download_all(): > import tempfile >

[web2py] Re: Import SCV Button

2012-07-29 Thread Massimo Di Pierro
In view: download all In controller def download_all(): import tempfile tmp = tempfile.TemporaryFile() db.export_to_csv_file(tmp) tmp.seek(0) return response.stream(tmp) On Sunday, 29 July 2012 03:07:40 UTC-5, Hassan Alnatour wrote: > > Dear ALL, > > How can i make a button

[web2py] Re: session.about[0].NodeNav.nodeID!=session.id error.

2012-07-29 Thread Massimo Di Pierro
Should become: for a in session.about: if a['Nav']['id ']==32 and a['NodeNav']['frontend']: On Sunday, 29 July 2012 02:39:03 UTC-5, Annet wrote: > > Massimo, > > Thanks for your reply. > > You should not store rows in session. You can do session.rows = >> rows.as_list() and

[web2py] Re: web2py on appfog

2012-07-29 Thread Massimo Di Pierro
Thanks this is useful information. On Saturday, 28 July 2012 23:04:06 UTC-5, spiffytech wrote: > > Tonight I threw up a copy of my personal site, just to see if AppFog is > worth looking into. Perhaps my experience would have been better if I tried > during business hours while their live chat s

[web2py] Re: dynamic queries

2012-07-29 Thread dave
instead of using the above I went with the code below, if anyone comes across this problem queries=[] if arg1 == "xyz": queries.append(db.abc.id > 0) if arg2 == "abc": queries.append(db.abc.age > 5) query = reduce(lambda a,b:(a&b),queries) and you can insert this query into

[web2py] Re: is_impersonating() as boolean in menu

2012-07-29 Thread weheh
I haven't traced through all the code carefully, but is_impersonating() returns current.session.auth.impersonator, which is based on a cPickle. So you're not getting a boolean, as you might be led to expect from the name of the function. On Sunday, July 29, 2012 1:38:42 PM UTC+8, mweissen wro

[web2py] SQLFORM.factory in a model -- huge performance degradation with db size

2012-07-29 Thread weheh
I've got an SQLFORM.factory inside a model. Very standard stuff: form = SQLFORM.factory(db.mytable, record=db.mytable[myindex]) The problem is, as I insert users into db.auth_user, the above SQLFORM.factory statement takes longer and longer to execute. It begins by executing in 0.05 seconds whe

[web2py] Import SCV Button

2012-07-29 Thread Hassan Alnatour
Dear ALL, How can i make a button that lets the user download a scv file for on of my tables ? best regards, --

[web2py] Is Vars Bad for SEO?

2012-07-29 Thread Hassan Alnatour
Dear ALL, I want to change all the page i use args in to vars so i can use args to make my urls more descriptive for SEO , now if i move everything to vars is it bad for SEO or what , what do you recommend ? --

[web2py] Re: session.about[0].NodeNav.nodeID!=session.id error.

2012-07-29 Thread Annet
Massimo, Thanks for your reply. You should not store rows in session. You can do session.rows = > rows.as_list() and this is safer. You would be caching a list of > dictionaries instead of a rows object. > So, session.about=db((db.NodeNav.nodeID==session.id)&(db.NodeNav.navID==db.Nav.id)&(db.