[sqlalchemy] Hang while committing to sqlite db using ironpython

2013-08-01 Thread Agus Wang
I'm using ironpython 2.7.3 and sqlalchemy(0.7.10) on my windows environment I've set up the database in sqlite using sqlalchemy declarative syntax, this works fine But when I try to save some data to the db using commit() My program suddenly hang but the actual data has been saved to the db This

[sqlalchemy] Re: Extending sqlalchemy.schema.Table

2013-08-01 Thread askel
There is column_reflect event triggered for each column during table reflection. Most likely your extra functionality depends on some columns so I'd look at something like: from sqlalchemy.event import listens_for columns_to_reflect = set(('id', 'name', 'real_name',

Re: [sqlalchemy] Extending sqlalchemy.schema.Table

2013-08-01 Thread Simon King
It's a horrible hack, but did you know that you can change the class of an instance by assigning to its __class__ attribute? I've no idea if SA does anything that would stop this from working, but you could try it. Start by creating a subclass of Table with your extra methods, then iterate over

Re: [sqlalchemy] Extending sqlalchemy.schema.Table

2013-08-01 Thread askel
No offence but it feels like direct route to the hell. Monkeypatching is acknowledged to be really bad practise in general with few exemptions. On Thursday, August 1, 2013 9:47:45 AM UTC-4, Simon King wrote: It's a horrible hack, but did you know that you can change the class of an instance

Re: [sqlalchemy] Extending sqlalchemy.schema.Table

2013-08-01 Thread Michael Bayer
as I mentioned earlier, SQLAlchemy-Migrate has done it this way for years. I'm not a fan of it which was one of several reasons I wrote Alembic, but it does work for them. On Aug 1, 2013, at 10:21 AM, askel dummy...@mail.ru wrote: No offence but it feels like direct route to the hell.

Re: [sqlalchemy] Extending sqlalchemy.schema.Table

2013-08-01 Thread Gustavo Baratto
I did this to quickly test my own extended ResultProxy object, but as soon figured out how easy was to properly instantiate a new ResultProxy subclass from an existing ResultProxy object, I got rid of this monkeypatching. I'd like to avoid that route if possible. Thanks! :) g. On Thu, Aug 1,

Re: [sqlalchemy] Re: Extending sqlalchemy.schema.Table

2013-08-01 Thread Gustavo Baratto
Hi Askel... What I'd like to accomplish is to add few more attributes and methods to Table (or maybe override insert/update/delete/select) to do post processing of the Result/Row proxies and return them in different formats such as json, yaml, xml, etc... so, while you suggestion is really neat,

[sqlalchemy] Re: Hang while committing to sqlite db using ironpython

2013-08-01 Thread Agus Wang
I've tested on python 2.7.3 with SQLAlchemy 0.8.2 and it works fine I think the problem is the ironpython, is sqlalchemy compatible with ironpython? On Thursday, August 1, 2013 5:56:36 PM UTC+7, Agus Wang wrote: I'm using ironpython 2.7.3 and sqlalchemy(0.7.10) on my windows environment