[web2py] upload field change filename

2011-03-31 Thread Manuele Pesenti
Hi *, is there a way to modify the file name with whom a file is stored in the filesystem using an upload field? I tryied in this way but without success: def upload_static_overlay_form_processing(form): # here "form.vars.shp" contains the file object and ## "form.vars.shp.filename" is

Re: [web2py] Re: get the path from an upload Field

2011-03-30 Thread Manuele Pesenti
'%s_%s%s' %(root, path, ext) >         img.save('%sstatic/uploads/%s' % (request.folder, filename)) >     except Exception, e: >         return e >     else: >         return filename -- Manuele Pesenti         amicogodzi...@jabber.linux.it         https://sites.google.com/site/manuelepesenti/

[web2py] get the path from an upload Field

2011-03-30 Thread Manuele Pesenti
Hi *, I'm trying to implement a form for upload in one time more than one file. Sometimes file format specifications contemplate more than one file with the same name in the same directory with different extentions such as in the case of shape files for GIS poroposes. Is it possible to use the

Re: [web2py] Re: Dynamic generation model

2011-03-15 Thread Manuele Pesenti
Dear Jose, I think you posted a very interesting example... how have you resolved the problem of the spatial support by web2py? I mean the fields of the tables you are going to create dynamically are the ones of a tipically spatial extension of a db... are they supported by web2py DAL? Can you

Re: [web2py] Re: advanced form question

2011-03-14 Thread Manuele Pesenti
http://groups.google.com/groups/advanced_search?safe=off&q=group:web2py to find more entries with "cascaded" (type the word in the form where it says "all these words:"). On Mar 8, 5:09 am, Manuele Pesenti wrote: Dear all, I need to construct a form with some fields that

Re: [web2py] Re: advanced form question

2011-03-09 Thread Manuele Pesenti
Il 09/03/2011 04:44, DenesL ha scritto: That is called cascaded fields. One example:http://groups.google.com/group/web2py/msg/b2d536d444001565 Use the advanced group search http://groups.google.com/groups/advanced_search?safe=off&q=group:web2py to find more entries with "cascaded" (type the word

[web2py] advanced form question

2011-03-08 Thread Manuele Pesenti
Dear all, I need to construct a form with some fields that has to be choosen within a different set depending on another fields value... is there some examples on line to get inspiration from? I try to be a little more clear... if I have a field like that: Field('a', 'integer', requires=IS_I

Re: [web2py] Re: SQLFORM field validator

2011-03-03 Thread Manuele Pesenti
Il 03/03/2011 08:27, pbreit ha scritto: What is it doing and what are you expecting? as I said after I need that only if null the two fields has to be the same. And I want to use a form builded via SQLFORM.factory because my form is not stricly related to a db table. I hope I've been more clear

[web2py] Re: SQLFORM field validator

2011-03-02 Thread Manuele Pesenti
Il 03/03/2011 08:14, Manuele Pesenti ha scritto: Hi *, I got an sqlform created with SQLFORM.factory and I want to assign a validator to a field of theirs that depend to the value of another field so I have do asign validators outside the form definition such as is done in this example I

[web2py] SQLFORM field validator

2011-03-02 Thread Manuele Pesenti
Hi *, I got an sqlform created with SQLFORM.factory and I want to assign a validator to a field of theirs that depend to the value of another field so I have do asign validators outside the form definition such as is done in this example I found that use a table: db.define_table('t','Field('a

Re: [web2py] Re: update computed value

2011-02-23 Thread Manuele Pesenti
Il 23/02/2011 15:18, DenesL ha scritto: That solution also works, it just uses the compute function to do the update. But*any* of the solutions mentioned above also works. You can either update*all* fields involved in the computation or use the function stored in compute to do it. you're rig

Re: [web2py] Re: update computed value

2011-02-23 Thread Manuele Pesenti
ok I found the solution in an old post of this list, if you are interested in just click the link below http://www.mail-archive.com/web2py@googlegroups.com/msg56102.html thanks Cheers Manuele

Re: [web2py] Re: update computed value

2011-02-23 Thread Manuele Pesenti
? Is it possible to add this example in the manual? it doesn't look to me so easy... Thank you so much Cheers Manuele ... but this does not db(query).update(a='x') because no enough info is provided. On Feb 22, 9:39 am, Manuele Pesenti wrote: Dear users, if I ch

[web2py] update computed value

2011-02-22 Thread Manuele Pesenti
Dear users, if I change a value in a function called by e computed field formula how can I update the computed field values? I tryed db(db.tab.id>0).update(id=db.tab.id) but nothing happened Thank you Manuele

Re: [web2py] Re: Spatial Database Modeling

2011-02-22 Thread Manuele Pesenti
Il 22/02/2011 00:16, Tim Michelsen ha scritto: Is the code developed by Mr. Tsega somewhere available online? I couldn't find an email address with the thesis... I found mr Tsega email address looking inside this list archive and I contacted him, I'll be asking him about it... on the first appro

Re: [web2py] Re: Spatial Database Modeling

2011-02-21 Thread Manuele Pesenti
ions have to be done. Thankyou for any suggestion Bye Manuele Il 03/11/2010 14:02, Manuele Pesenti ha scritto: 2010/11/2 mdipierro: Most of that work was done on a very old web2py version. I never had the time to merge with the most current version. I have the thesis and I should go back st

Re: [web2py] Re: function in query

2011-02-14 Thread Manuele Pesenti
Il 14/02/2011 19:57, villas ha scritto: Well, this might not help at all... but maybe you can pick out something to give you a step forward:) I cannot see how, the problem is the introduction of a function inside an expression in which appears fields objects that contains date or datetime ob

Re: [web2py] Re: function in query

2011-02-14 Thread Manuele Pesenti
Il 11/02/2011 18:53, Massimo Di Pierro ha scritto: db(db.mytab.date1-db.mytab.date1 == datetime.timedelta(days=2).select() must be db(db.mytab.date1 == db.mytab.date1 + datetime.timedelta(days=2).select() a query has the form field = expression. You cannot have the expression on the left-hand

[web2py] function in query

2011-02-11 Thread Manuele Pesenti
Hi, how can I select records of a table that got 2 date fields (one datetime and a simple date) wich difference is a fixed value? I thought this solution: import datetime today=datetime.datetime.today() yesterday = today.date() - datetime.timedelta(days=1) db.define_table('mytab', ...

[web2py] Re: request.vars problem

2011-02-08 Thread Manuele Pesenti
ect But another quest remains: Why I get a string using request.vars when nothing about it is said in the manual? http://web2py.com/book/default/chapter/04#request thank you bye Manuele Il 08/02/2011 12:56, Manuele Pesenti ha scritto: Hi *, I'm trying pass some variables from one

[web2py] request.vars problem

2011-02-08 Thread Manuele Pesenti
Hi *, I'm trying pass some variables from one one controller/function to another using the command: URL(request.application, 'myControler', 'myFunction', vars=dict(myVar=myVar)) but when I call request.vars.myVar I get a string type object even if myVar was a dictionary. I cannot bypass thi

Re: [web2py] Re: unique constraint of multiple columns (at database level)

2011-01-11 Thread Manuele Pesenti
Il 11/01/2011 10:05, dederocks ha scritto: Manuele, May I ask you how you did it? First of all consider to define a function that returns a unique result starting from your fields in the uniques list. If theese fields are all integer (such as id of external references) you can simply append th

Re: [web2py] Re: unique constraint of multiple columns (at database level)

2011-01-05 Thread Manuele Pesenti
I beg your pardon... it works! the problem was that I used 'unique' as the field name that is a not valid name :) so it coud be a solution to manage uniques bye M. Il 05/01/2011 12:04, Manuele Pesenti ha scritto: Trying quite the same solution I got a different error: [omissi

Re: [web2py] Re: unique constraint of multiple columns (at database level)

2011-01-05 Thread Manuele Pesenti
Trying quite the same solution I got a different error: Traceback (most recent call last): File "/home/manuele/Progetti/web2py/gluon/restricted.py", line 188, in restricted exec ccode in environment File "/home/manuele/Progetti/web2py/applications/wrf_dbi/models/wrfdb.py"

Re: [web2py] Re: unique constraint of multiple columns (at database level)

2010-12-29 Thread Manuele Pesenti
Il 28/12/2010 23:40, Luther Goh Lu Feng ha scritto: Is there a reason why you are not using Auth, if you aren't? http://www.web2py.com/book/default/chapter/08#Authentication Anyway, assuming that you truly want to add the unique constraint, then I am guessing that you could construct virtual fi

Re: [web2py] Re: cron quest

2010-12-27 Thread Manuele Pesenti
Il 28/12/2010 08:18, mdipierro ha scritto: that is fine. Window, Mac, Linux? Which version? Which Python version? What command do you use python web2py.py ? I beg your pardon :) I'm using web2py Version 1.87.3 (2010-10-13 19:44:46) with Python 2.6.5 on Ubuntu 10.04.. and yes the commend I use

Re: [web2py] Re: cron quest

2010-12-27 Thread Manuele Pesenti
Il 27/12/2010 17:58, mdipierro ha scritto: how do you start web2py? that was my doubt... I just run web2py from it's path where I downloaded it. Is it correct? thank you bye Manuele

[web2py] cron quest

2010-12-27 Thread Manuele Pesenti
Hi *! I'm trying to set up a function in crontab, I'd like to run it daily or after run web2py so following the doc I write the crontab file as follows: #crontab @reboot * * * * root *cronfun/fetch_all_data @daily * * * * root *cronfun/fetch_all_data now running web2py it seams it h

Re: [web2py] Re: Spatial Database Modeling

2010-11-03 Thread Manuele Pesenti
2010/11/2 mdipierro : > Most of that work was done on a very old web2py version. I never had > the time to merge with the most current version. I have the thesis and > I should go back study it. can I help you in some way? I'm interested in it... > > Massimo -- Manuele Pesenti

Re: [web2py] Re: Spatial Database Modeling

2010-11-03 Thread Manuele Pesenti
2010/11/2 mdipierro : > Most of that work was done on a very old web2py version. I never had > the time to merge with the most current version. I have the thesis and > I should go back study it. can I help you in some way? I'm interested in it... > > Massimo -- Manuele Pesenti

[web2py] controler with external ref

2010-10-20 Thread Manuele Pesenti
Hi, I'm trying to set up a controler with a form that reproduce some fields of a db table I have in my models because I want to mix information that goes in db table with other fields I need. The problem is when I try to reproduce a field (the last one here under) that is an external reference

[web2py] multiselection widget with IS_LIST_OF validator

2010-10-18 Thread Manuele Pesenti
Hi *, I'm trying to use multiselection widget[1] with IS_LIST_OF validator in order to validate single choices but I got a strange error like this: SyntaxError: widget cannot determine options of no_table.from_tables here is the code I used in my controllers file where I want to define a form

[web2py] transaction block

2010-10-14 Thread Manuele Pesenti
Hi *, I'm a new web2py user and I got this error for the second time: InternalError: current transaction is aborted, commands ignored until end of transaction block The problem is that this error still appear even after restoring the source code and restarting the web2py server the first ti

<    1   2   3   4   5   6