[web2py] Re: components and sessions

2011-09-20 Thread DenesL
On Sep 20, 12:30 pm, Massimo Di Pierro wrote: > I do not understand what is causing this. To have the same session?. Isn't that the way sessions are supposed to work?. My hunch is still that components need their own session, associated to the main one somehow. > Please open a ticket and link

[web2py] Re: components and sessions

2011-09-20 Thread Massimo Di Pierro
I do not understand what is causing this. Please open a ticket and link this thread so it does not get lost. I try process tickets before other issues. On Sep 20, 7:04 am, DenesL wrote: > On Sep 19, 10:57 pm, Massimo Di Pierro > wrote: > > > Can you help me with wireshark and see if the ajax req

[web2py] Re: components and sessions

2011-09-20 Thread DenesL
On Sep 19, 10:57 pm, Massimo Di Pierro wrote: > Can you help me with wireshark and see if the ajax requests send or > not back he cookie? What browser did you use? With Firebug in Firefox: GET db1login.load web2py-component-location http://127.0.0.1:8000/timesap/test/index web2py-compon

[web2py] Re: components and sessions

2011-09-19 Thread Massimo Di Pierro
Can you help me with wireshark and see if the ajax requests send or not back he cookie? What browser did you use? Can you reproduce with multiple browsers? My explanations must be wrong because the two sessions would not get the same id. On Sep 19, 8:53 pm, DenesL wrote: > On Sep 19, 7:52 pm, Ma

[web2py] Re: components and sessions

2011-09-19 Thread DenesL
On Sep 19, 7:52 pm, Massimo Di Pierro wrote: > I did not try reproduce this but I can see a race condition caused by > the browser. I make a guess. Actually it is pretty simple to reproduce. As posted above, there is an index page containing several LOAD commands. To keep it simple, say there i

[web2py] Re: components and sessions

2011-09-19 Thread Massimo Di Pierro
I did not try reproduce this but I can see a race condition caused by the browser. I make a guess. When the page is loaded there is no session. Depending on the browser it performs two ajax loads. There are three concurrent requests, the outer page, and the two ajax requests. There is noway to tel

[web2py] Re: components and sessions

2011-09-19 Thread DenesL
When the initial LOADs execute, two session files are created and each holds the appropriate formkey for each form. But on submit one of the session files is never read or updated again, hence the corresponding form does not accept. Almost sure this is bug, I just don't know where. Denes.

[web2py] Re: components and sessions

2011-09-18 Thread DenesL
^bump^

[web2py] Re: components and sessions

2011-09-16 Thread DenesL
Nope, each form name is equal to the function name, so when TSlogin is called the form name is 'TSlogin' and when B1login is called the form name is 'B1login', same for the logouts. Note that form.accepts pattern is: if form.accepts(request, session, formname=func_name): ... The printed session

[web2py] Re: components and sessions

2011-09-16 Thread Massimo Di Pierro
I see. The problem is that you have two forms called login in the same page. This is very exotic. One of the two must be customized to used a different formname. On Sep 16, 2:31 pm, DenesL wrote: > I could send you a private email later but the general flow is: > > index.html > -- > {{ext

[web2py] Re: components and sessions

2011-09-16 Thread DenesL
I could send you a private email later but the general flow is: index.html -- {{extend 'layout.html'}} TS database B1 database {{=LOAD(url=URL('TSlogin.load'), ajax=True, target='TSlogin')}} {{=LOAD(url=URL('B1login.load'), ajax=True, targe

[web2py] Re: components and sessions

2011-09-16 Thread Massimo Di Pierro
Can you post an example of the code you are writing? On Sep 16, 12:24 pm, DenesL wrote: > I am trying to write an app that connects to 2 databases at the same > time using components. > There is a component to handle logon forms to each db. > The index page has a LOAD for each db logon component

[web2py] Re: components and sessions

2011-03-29 Thread carlo
wow! I would never have thought about the missing space while the extra curly brace was a typo in my post, thank you! On 29 Mar, 16:48, Massimo Di Pierro wrote: > The problem is that > > {{session.mysession={}}} > {{session.mysession['mylabel']=comment.body}}} > > should be > > {{session.mysessio

[web2py] Re: components and sessions

2011-03-29 Thread Massimo Di Pierro
The problem is that {{session.mysession={}}} {{session.mysession['mylabel']=comment.body}}} should be {{session.mysession={} }} # missing space {{session.mysession['mylabel']=comment.body}} # too many } On Mar 29, 3:11 am, carlo wrote: > Massimo, I omitted a test case because it seems occurr

[web2py] Re: components and sessions

2011-03-29 Thread carlo
Massimo, I omitted a test case because it seems occurring in any of my components and it can easily reproduced. Here using the component example in the Book (modified a bit): model: db.define_table('comment', Field('body','text',label='Your comment'), Field('posted_on','datetime',default=r

[web2py] Re: components and sessions

2011-03-28 Thread Massimo Di Pierro
what do you mean by "fails" can you provide a test case? On Mar 28, 5:15 pm, carlo wrote: > I have a behaviour I can not explain. > > In a controller this is a regular syntax: > > session.mysession={} > session.mysession['myfield']=myvalue > > but in a .load component the same fails. > > On the o