[sqlalchemy] Soft Delete Pattern in SQLAlchemy

2012-09-24 Thread Mahmoud Abdelkader
I wanted to know some views about the soft-delete (anti?) pattern and whether or not I'm going about it the right way in my code base. We have a piece of code: class NoDeletedQuery(Query): def __new__(cls, *args, **kwargs): if args and hasattr(args[0][0], deleted_at):

Re: [sqlalchemy] Soft Delete Pattern in SQLAlchemy

2012-09-24 Thread Mahmoud Abdelkader
only for dynamic relationships. How can I change this behavior? Thanks again! On Mon, Sep 24, 2012 at 11:45 AM, Michael Bayer mike...@zzzcomputing.comwrote: On Sep 24, 2012, at 1:48 PM, Mahmoud Abdelkader wrote: I wanted to know some views about the soft-delete (anti?) pattern and whether

[sqlalchemy] How to determine many-to-many relations using object_mapper().iterate_properties?

2011-04-20 Thread Mahmoud Abdelkader
I'm having a bit of trouble with this snippet from another stackoverflow question: http://stackoverflow.com/questions/1623661/sqlalchemy-shallow-copy-avoiding-lazy-loading The snippet in question: from sqlalchemy.orm import object_mapper, ColumnProperty, RelationProperty newobj =

[sqlalchemy] Altering to add an enum to an existing Enum Column type

2011-03-25 Thread Mahmoud Abdelkader
Hello everyone:) I have a table with a enum column containing statuses: STARTED, RESERVED, FINISHED. I want to add a status WAITING to this enum using SQLAlchemy without dropping down into SQL. I'm using PostgreSQL 8.4.6 I don't think there's a way to do it without dropping into SQL. Any ideas?

Re: [sqlalchemy] Altering to add an enum to an existing Enum Column type

2011-03-25 Thread Mahmoud Abdelkader
on how things like this are done. On Mar 25, 2011, at 7:15 PM, Mahmoud Abdelkader wrote: Hello everyone:) I have a table with a enum column containing statuses: STARTED, RESERVED, FINISHED. I want to add a status WAITING to this enum using SQLAlchemy without dropping down into SQL. I'm

Re: [sqlalchemy] How do I set the transaction isolation level in SQLAlchemy for PostgreSQL?

2010-08-22 Thread Mahmoud Abdelkader
PM, Mahmoud Abdelkader wrote: NOTE: I originally posted this question to stack overflow, http://stackoverflow.com/questions/3518863/how-do-i-set-the-transaction-isolation-level-in-sqlalchemy-for-postgresql, but I haven't received an answer yet. If I find the answer here, I'll send it over

[sqlalchemy] How do I set the transaction isolation level in SQLAlchemy for PostgreSQL?

2010-08-19 Thread Mahmoud Abdelkader
NOTE: I originally posted this question to stack overflow, http://stackoverflow.com/questions/3518863/how-do-i-set-the-transaction-isolation-level-in-sqlalchemy-for-postgresql, but I haven't received an answer yet. If I find the answer here, I'll send it over to stackoverflow for thoroughness.