[web2py:12496] Re: IS_IN_DATASET validator for filling SELECT with data from code not database

2008-11-25 Thread cjparsons
Ah, thought there must be an existing way of doing it but I didn't realise you could use 'labels=' with IS_IN_SET :-) On Nov 26, 1:59 am, DenesL <[EMAIL PROTECTED]> wrote: > cj, wouldn't that be equivalent to: > > db.table.myField.requires=IS_IN_SET([0,1,2],labels=[T('Alpha'), T > ('Beta'),T('Gam

[web2py:12495] Re: itemize temporary data

2008-11-25 Thread mdipierro
What are you suggesting? On Nov 25, 11:17 pm, Baron <[EMAIL PROTECTED]> wrote: > thanks guys for your advice. > > > I would just take the code out of t2 itemize and adapt to your purposes. It > > is relatively small. > > I did suggest at the outset (18/11) that creating a new version of itemiz

[web2py:12494] Re: itemize temporary data

2008-11-25 Thread Baron
thanks guys for your advice. > I would just take the code out of t2 itemize and adapt to your purposes. It > is relatively small. > I did suggest at the outset (18/11) that creating a new version of itemize > was probably the easiest solution :-). As I said I already have my own itemize func

[web2py:12493] Re: Using database and session in a user-defined class

2008-11-25 Thread Jonathan Benn
Hi, Ok, thanks for the responses. On Nov 25, 5:30 pm, mdipierro <[EMAIL PROTECTED]> wrote: > You should look into the T2 source code. The class T2 is defined in a > module. When the module is imported and instantiated you pass request, > response, session, cache, T and db to it and store refer

[web2py:12492] Re: IS_IN_DATASET validator for filling SELECT with data from code not database

2008-11-25 Thread DenesL
cj, wouldn't that be equivalent to: db.table.myField.requires=IS_IN_SET([0,1,2],labels=[T('Alpha'), T ('Beta'),T('Gamma')]) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to thi

[web2py:12491] Re: Join + Update a field

2008-11-25 Thread DenesL
Tito, change: new.update_record(characterHasAttribute.total_value=2) to: new.characterHasAttribute.update_record(total_value=2) Do a dir(new) and you will see why. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

[web2py:12490] Join + Update a field

2008-11-25 Thread Tito Garrido
Hi folks, I'm trying to update a value from a inner join query: new=db((db.character.id==1)&(db.character.id ==db.characterHasAttribute.id_character)&(db.characterHasAttribute.id_attribute==3)).select()[0] new.update_record(characterHasAttribute.total_value=2) The error is: new.update_record(cha

[web2py:12489] IS_IN_DATASET validator for filling SELECT with data from code not database

2008-11-25 Thread cjparsons
I wanted to have a field on an SQLFORM that behaved like IS_IN_DB (i.e. a drop box with values shown to the user and a corresponding id inserted into the database). I didn't want to take the source data from the database though because it is more program data than user data and I wanted to use in

[web2py:12488] Re: response.stream

2008-11-25 Thread mdipierro
I suggest you contact the author of the app directly. Massimo On Nov 25, 2:29 pm, "ga2arch(GA)" <[EMAIL PROTECTED]> wrote: > in html i have ="{{=URL(r=request, c='appadmin',f='download',args= > ['db',video.converted_video])}}"> > > this "string" return me the correct url but with a location cook

[web2py:12487] Re: response.stream

2008-11-25 Thread ga2arch(GA)
I'm not on GAE :D --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECT

[web2py:12486] Re: response.stream

2008-11-25 Thread ga2arch(GA)
in html i have ="{{=URL(r=request, c='appadmin',f='download',args= ['db',video.converted_video])}}"> this "string" return me the correct url but with a location cookie :( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

[web2py:12485] response.stream

2008-11-25 Thread ga2arch(GA)
Testing the video streaming app i saw that response.stream of web2py has a redirect cookie to /admin so it isn't possible to flash player to stream it. How can i solve this problem ?? thx in advance :D --~--~-~--~~~---~--~~ You received this message because you ar

[web2py:12484] Re: Date

2008-11-25 Thread annet
Massimo, Thanks for your reply, solutions like this add to my enthusiasm for web2py and Python. Best regards, Annet. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this gr

[web2py:12482] Re: Passing values to the flash helper

2008-11-25 Thread Yarko Tymciurak
NP Voltron - In one way, I'm grateful you had this trouble. We are sure to have some slow, good-thinking discussion on how a crisply defined table-CRUD set would look and be separated from a record CRUD. Massimo raised the point of everything deriving from the built-in class "dict" (including "

[web2py:12483] Re: Date

2008-11-25 Thread mdipierro
I added some lines and marked with # def byplace(): response.functionname=T('Club locator op plaats') form=FORM('Type een plaatsnaam:', INPUT(_type='text',_name='plaatsnaam',requires=IS_NOT_EMPTY ()), INPUT(_type='submit')) if form.accepts(request.vars,session):

[web2py:12481] Re: Date

2008-11-25 Thread annet
I took up replacing my HTML forms with FORMs. My first use case is a page on which a visitor types in a city and submits the page by clicking a submit button (a form in the left column of the page). The controller function should query the database for leisure clubs in that city and the result sh

[web2py:12480] Re: your recommended way of calling controllers from the command line ?

2008-11-25 Thread mdipierro
Understood. That is what exec_environment is for. On Nov 25, 9:54 am, achipa <[EMAIL PROTECTED]> wrote: > a) is clear > > b) Benchmarking, notifications, automation, basically anything that is > not an interactive user request coming from a browser. Modules are > cumbersome as you have to import

[web2py:/] Re: your recommended way of calling controllers from the command line ?

2008-11-25 Thread achipa
a) is clear b) Benchmarking, notifications, automation, basically anything that is not an interactive user request coming from a browser. Modules are cumbersome as you have to import loads of controller style logic and you end up with one-liner controller functions which just invoke module functi

[web2py:12478] Re: DAL - Segregate connections & queries

2008-11-25 Thread mdipierro
and you can save more coding with one statement that duplicates all tables: [db2.define_table(name,db1[name]) for name in db1.tables] On Nov 25, 2:42 am, vihang <[EMAIL PROTECTED]> wrote: > My only hesitation was defining the table twice and THATs SOLVED !!! > Thanks a ton ! > > On Nov 25

[web2py:12475] Re: your recommended way of calling controllers from the command line ?

2008-11-25 Thread mdipierro
Sorry, I misunderstood the question. Answer a) With -R you can execute a script. You can use exec_environment(...) to call a function in a controller. It is described in the manual. Answer b) If you feel you need to do this perhaps something is wrong. perhaps the function belongs to a module, no

[web2py:12477] Re: Passing values to the flash helper

2008-11-25 Thread voltron
ahh, that was the problem, a typo of some sort! I was staring at it the whole time and did not see it, no reason for me to update the table definitions :-)) Thanks a lot guys --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

[web2py:12476] Re: DAL IntegrityError

2008-11-25 Thread mdipierro
I think the problem is that you have a notnull column without default. This causes a problem when doing a migration. On Nov 25, 9:13 am, annet <[EMAIL PROTECTED]> wrote: > The following lines of code are part of my model: > > db.define_table('sleutelwoord', > SQLField('woord', length=20, not

[web2py:12474] DAL IntegrityError

2008-11-25 Thread annet
The following lines of code are part of my model: db.define_table('sleutelwoord', SQLField('woord', length=20, notnull=True, unique=True), SQLField('verzameling', type='integer', length=1, notnull=True, unique=True), migrate='sleutelwoord.table') db.define_table('event', SQLFiel

[web2py:12473] Re: your recommended way of calling controllers from the command line ?

2008-11-25 Thread achipa
Maybe it's just the lack of coffee, but... how do you call a function in the controller via -R without ending up with cruft in the calling code or the controller itself ? On Nov 25, 3:26 pm, mdipierro <[EMAIL PROTECTED]> wrote: > -R is the cleanest way. ;-) > > On Nov 25, 4:55 am, achipa <[EMAIL

[web2py:12472] Re: Using database and session in a user-defined class

2008-11-25 Thread mdipierro
You should look into the T2 source code. The class T2 is defined in a module. When the module is imported and instantiated you pass request, response, session, cache, T and db to it and store references to them as member variables. Another way would be to execute modules, instead of importing the

[web2py:12471] Re: your recommended way of calling controllers from the command line ?

2008-11-25 Thread mdipierro
-R is the cleanest way. ;-) On Nov 25, 4:55 am, achipa <[EMAIL PROTECTED]> wrote: > The subject says it all. I know a couple of methods (python -R > wrapper, the older -S patch, piping, etc), but was wondering which you > think is the cleanest (and cross platform) as I'd like to integrate it > in

[web2py:12470] Re: Passing values to the flash helper

2008-11-25 Thread mdipierro
NEVER DO db.table.update() that changes the definition of the table not the records. To update records you need to follow Yarko suggestion: db(.).update(.) Massimo On Nov 25, 2:56 am, "Yarko Tymciurak" <[EMAIL PROTECTED]> wrote: > you can add this if / where you need: >

[web2py:12469] Re: Using database and session in a user-defined class

2008-11-25 Thread José Deodoro de Oliveira Filho
Hi, You see, session, request and response are not globals "per se", they depend on the session you're responding to. From what I can tell the controller functions are "wrapped" inside an environment just before they're called and that's why you have those variables around. So, the way it's built,

[web2py:12468] Re: "No databases in this application" on GAE

2008-11-25 Thread Jonathan Benn
On Nov 24, 5:16 pm, mdipierro <[EMAIL PROTECTED]> wrote: > In principle I would like to move t2.search into appadmin and thet > would solve the problem. How do people fill about it? If it allows the appadmin to work fine on GAE, then I'm totally in favour. :-D --Jonathan --~--~-~--~---

[web2py:12467] Re: "No databases in this application" on GAE

2008-11-25 Thread Jonathan Benn
On Nov 25, 5:01 am, sharekey <[EMAIL PROTECTED]> wrote: >     I try your code, it work well, I can select records > fromhttp://127.0.0.1:8080/myapp/appadmin/select/db/mytablenow. I find the > two modifications in select function is : >     1) Replace "query='%s.id>0' % table" with "query = dbnam

[web2py:12466] Using database and session in a user-defined class

2008-11-25 Thread Jonathan Benn
Hi all, Is there a simple way to access the dynamic web2py global variables (db, session, request, response) from inside a user defined class? If I were to define the class inside the controller, then I'd have no trouble. However, if I define the class in a separate module (i.e. in the "modules

[web2py:12465] your recommended way of calling controllers from the command line ?

2008-11-25 Thread achipa
The subject says it all. I know a couple of methods (python -R wrapper, the older -S patch, piping, etc), but was wondering which you think is the cleanest (and cross platform) as I'd like to integrate it into my cron patch (so you could specify controllers/functions in your crontab file, not just

[web2py:12464] Re: Passing values to the flash helper

2008-11-25 Thread Yarko Tymciurak
you can add this if / where you need: id = row.id On Tue, Nov 25, 2008 at 2:53 AM, Yarko Tymciurak <[EMAIL PROTECTED]> wrote: > Here, Voltron - see if this makes more sense: > > On Tue, Nov 25, 2008 at 12:01 AM, mdipierro <[EMAIL PROTECTED]>wrote: > >> >>id=db.users.upda

[web2py:12463] Re: Passing values to the flash helper

2008-11-25 Thread Yarko Tymciurak
Here, Voltron - see if this makes more sense: On Tue, Nov 25, 2008 at 12:01 AM, mdipierro <[EMAIL PROTECTED]> wrote: > >id=db.users.update( > email= form.vars.email, > password = form.vars.password >

[web2py:12462] Re: DAL - Segregate connections & queries

2008-11-25 Thread vihang
My only hesitation was defining the table twice and THATs SOLVED !!! Thanks a ton ! On Nov 25, 11:57 am, mdipierro <[EMAIL PROTECTED]> wrote: > If I understand... > > #create two connections > db1=SQLDB(...) > db2=SQLDB(...) > > #define the tables twice (perhaps using the following trick) > db1.d

[web2py:12461] Re: Passing values to the flash helper

2008-11-25 Thread voltron
Massimo, insert is wrong since I am presenting the user a form to manage her/his existing user settings. I needed commit() as a result of a discussion we had a few months ago, I am sending the user a verification mail and doing some other stuff in the same controller, it is supposed to trigger a s