Just pulled now. Fixed! Great thanks. On Thursday, October 11, 2012 6:20:45 AM UTC+13, Massimo Di Pierro wrote: > > Can you try again? I think I fixed this in trunk. > > > On Tuesday, 2 October 2012 22:08:58 UTC-5, Matt wrote: >> >> Just testing it now, Getting an error on GAE + CloudSQL: >> >> File "/Projects/www//applications/app/models/db.py", line 45, in <module> >> auth.define_tables() >> File "/Projects/www/gluon/tools.py", line 1506, in define_tables >> format='%(first_name)s %(last_name)s (%(id)s)')) >> File "/Projects/www/gluon/dal.py", line 7050, in define_table >> table = self.lazy_define_table(tablename,*fields,**args) >> File "/Projects/www/gluon/dal.py", line 7081, in lazy_define_table >> polymodel=polymodel) >> File "/Projects/www/gluon/dal.py", line 935, in create_table >> self.file_close(tfile) >> File "/Projects/www/gluon/dal.py", line 4005, in file_close >> fileobj.close() >> AttributeError: DatabaseStoredFile instance has no attribute 'close' >> >> Matt >> >> On Tuesday, October 2, 2012 3:32:16 PM UTC+13, Massimo Di Pierro wrote: >>> >>> There is a big change in DAL. >>> >>> a = DAL(uri) >>> b = DAL(uri) >>> >>> now "a is b" because DAL is a singleton (almost). It is a thread local >>> singleton as long a uri is specified. >>> What does this mean in practice? >>> >>> It means that unless you have lazy virtual fields, Row and Rows objects >>> can be serialized (pickled), properly cached, and stored in session. >>> For example: >>> >>> session.rows = session.rows or db(db.mytable).select() >>> >>> and you can still do: >>> >>> session.rows.first().update_record(....) >>> >>> has many practical implications in the way you program and there is even >>> more we could do. In the future we may be able to serialize every DAL >>> expression. >>> >>> This is a big change in the source and the internal logic is complex. >>> It may have some unforeseen side effects. >>> PLEASE TEST THAT TRUNK DOES NOT BREAK YOUR CODE before this makes it >>> into stable. >>> >>> massimo >>> >>> >>> >>> >>> >>>
--