The trunc version solved my problem

2012/10/16 Massimo Di Pierro <[email protected]>

> This helped a lot. I was able to reproduce it and fix it. Can you please
> check it in trunk. I can post 2.1.2 later tonight.
>
>
> On Monday, 15 October 2012 19:18:09 UTC-5, Ricardo Pedroso wrote:
>
>> Forget to mention that you must make two requests, the first one will
>> save the
>> session and the second one will read from session and will fail
>>
>> Ricardo
>>
>> On Tue, Oct 16, 2012 at 1:10 AM, Ricardo Pedroso <[email protected]>
>> wrote:
>> > On Mon, Oct 15, 2012 at 9:37 PM, Massimo Di Pierro
>> > <[email protected]> wrote:
>> >> This is not the behavior. Quote the opposite. This should work better
>> in
>> >> web2py 2.1 than before. Can you post a simple app so that I can
>> reproduce it
>> >> and debug it?
>> >
>> > Below a simple app that expose the problem.
>> > I guess the problem is related to the dog Set in the person Row.
>> >
>> >
>> > ----------------------- models/db.py: ---------------------------
>> >
>> > # -*- coding: utf-8 -*-
>> >
>> > db = DAL('sqlite://storage.sqlite')
>> >
>> > db.define_table('person',
>> >         Field('name'),
>> >         )
>> >
>> > db.define_table('dog',
>> >         Field('name'),
>> >         Field('owner', db.person),
>> >         )
>> >
>> > if db(db.person).count() == 0:
>> >     jim = db.person.insert(name='Jim')
>> >     db.dog.insert(name='Boby', owner=jim)
>> >
>> >
>> > --------------- controllers/default.py: ---------------------
>> >
>> > # -*- coding: utf-8 -*-
>> >
>> > def index():
>> >     session.person = db(db.person).select().first()
>> >     return 'ok'
>> >
>> >
>> > Ricardo
>> >
>> >
>> >
>> >
>> >> On Monday, 15 October 2012 15:05:23 UTC-5, Ricardo Pedroso wrote:
>> >>>
>> >>> On Mon, Oct 15, 2012 at 9:01 PM, Ricardo Pedroso <[email protected]>
>>
>> >>> wrote:
>> >>> > On Mon, Oct 15, 2012 at 7:56 PM, Martin Weissenboeck <
>> [email protected]>
>> >>> > wrote:
>> >>> >> Upgraded to 2.1.1.
>> >>> >> I get:
>> >>> >>
>> >>> >> Traceback (most recent call last):
>> >>> >
>> >>> > (...)
>> >>> >
>> >>> >>   File "D:\web2py\gluon\dal.py", line 7146, in __getattr__
>> >>> >>
>> >>> >>
>> >>> >>     if ogetattr(self,'_lazy_tables') and \
>> >>> >>
>> >>> >>
>> >>> >> AttributeError: 'DAL' object has no attribute '_lazy_tables'
>> >>> >
>> >>> > I was hit by this, too.
>> >>> >
>> >>> > I track it down to a dal row that I was putting in session.
>> >>> > I was using:
>> >>> >    session.myvar = dal_row
>> >>> >
>> >>> > I solve it like:
>> >>> >    session.myvar = Storage(dal_row.as_dict())
>> >>> >
>> >>>
>> >>>
>> >>> Massimo is it necessary to open a ticket about this or is this
>> >>> intended behavior?
>> >>>
>> >>> Ricardo
>> >>
>> >> --
>> >>
>> >>
>> >>
>>
>  --
>
>

-- 



Reply via email to