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
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
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
>
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
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
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
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
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
--~--~-~--~---
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,
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:
>
-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
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
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
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
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
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
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
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
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
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
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
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):
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 "
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
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
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
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
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
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
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
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
"
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
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
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
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
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
36 matches
Mail list logo