[sqlalchemy] Classes as model properties

2012-09-21 Thread Tefnet Developers
Hi, we are trying to migrate our old *Extension based SQLA code to new - event based. We also have class based properties that we want to keep. With old SQLA we have had to monkey-patch _as_declarative function to populate our properties. I wonder if it is possible to avoid doing it with

Re: [sqlalchemy] Classes as model properties

2012-09-21 Thread Tefnet Developers
21, 2012, at 2:59 AM, Tefnet Developers wrote: Hi, we are trying to migrate our old *Extension based SQLA code to new - event based. We also have class based properties that we want to keep. With old SQLA we have had to monkey-patch _as_declarative function to populate our properties. I wonder

Re: [sqlalchemy] Classes as model properties

2012-09-21 Thread Tefnet Developers
pattern. On Sep 21, 2012, at 2:59 AM, Tefnet Developers wrote: Hi, we are trying to migrate our old *Extension based SQLA code to new - event based. We also have class based properties that we want to keep. With old SQLA we have had to monkey-patch _as_declarative function to populate our

Re: [sqlalchemy] Classes as model properties

2012-09-21 Thread Tefnet Developers
W dniu 21.09.2012 17:19, Michael Bayer pisze: On Sep 21, 2012, at 10:57 AM, Tefnet Developers wrote: In fact we used to use metaclass way of handling this problem, but for some unknown reason it was changed to monkey patching _as_declarative :| Couple months ago I've read your post: http

Re: [sqlalchemy] Classes as model properties

2012-09-21 Thread Tefnet Developers
W dniu 21.09.2012 17:58, Michael Bayer pisze: On Sep 21, 2012, at 11:31 AM, Tefnet Developers wrote: W dniu 21.09.2012 17:19, Michael Bayer pisze: On Sep 21, 2012, at 10:57 AM, Tefnet Developers wrote: In fact we used to use metaclass way of handling this problem, but for some unknown

Re: [sqlalchemy] Re: integrity error in FK relation

2009-12-02 Thread Tefnet Developers - Tomasz Jezierski
Dnia 2009-12-01, Wt o godzinie 21:58 -0800, rajasekhar911 pisze: but this happen only when i use innodb as engine. didnt give an error on myisam on mysql or sqlite. Probably because myisam is not transactional and sqlite usually doesn't care about constraints. Tomasz Jezierski Tefnet

Re: [sqlalchemy] easy_install SQLAlchemy

2009-12-01 Thread Tefnet Developers - Tomasz Jezierski
Dnia 2009-12-01, Wt o godzinie 18:45 +0100, Alexandre Conrad pisze: Hey there, just wondering: easy_install SQLAlchemy downloads and installs version 0.5.2. Shouldn't it be 0.5.6? # easy_install SQLAlchemy Searching for SQLAlchemy Reading http://pypi.python.org/simple/SQLAlchemy/

Re: [sqlalchemy] Filter on relation???

2009-11-24 Thread Tefnet Developers - Tomasz Jezierski
Dnia 2009-11-24, Wt o godzinie 11:18 +0100, Christian Démolis pisze: Is it possible to put a filter on a relation in the declaration? Example : LeNomDuUtilisateur = relation(Utilisateur, filter_by=Utilisateur.Login, backref=backref('verrouillage')) I'm not sure what exactly your example

[sqlalchemy] Re: Query on a related object's field

2009-11-13 Thread Tefnet Developers - Tomasz Jezierski
Dnia 2009-11-13, Pt o godzinie 05:02 -0800, bojanb pisze: What is the easiest way of getting the equivalent of this: session.query(Someclass).filter_by(related_obj.field=somevalue) Ie. I want to filter by a field of an object that is in relation to objects of Someclass. My original

[sqlalchemy] Re: what time sqlalchemy 0.6 out?

2009-11-11 Thread Tefnet Developers - Tomasz Jezierski
Dnia 2009-11-10, Wt o godzinie 22:36 -0500, Michael Bayer pisze: haven't seen a DBAPI for drizzle as of yet. I don't use drizzle myself so I don't know how stable it is... but there is DBAPI for drizzle... https://launchpad.net/drizzle-interface/+milestone/ongoing-development On Nov

[sqlalchemy] Re: using ORM in AttributeExtension

2009-11-02 Thread Tefnet Developers
Dnia 2009-10-19, pon o godzinie 18:20 -0400, Michael Bayer pisze: you can disable the autoflush if you say query.autoflush(False).whatever(). I'd start there. Well I need autoflush there to have current data. At the same time the AttributeExtensions are firing off in the middle of a

[sqlalchemy] Re: using ORM in AttributeExtension

2009-11-02 Thread Tefnet Developers
Dnia 2009-11-02, pon o godzinie 16:07 -0500, Michael Bayer pisze: Providing AttributeExtension hooks to end users who can then write custom code without any attention to object/session state is never guaranteed to work completely. Um, that's not the case. We develop the extensions

[sqlalchemy] Re: Directly saving a dictionary of column values to SA...

2009-10-30 Thread Tefnet Developers - Tomasz Jezierski
Dnia 2009-10-30, Pt o godzinie 01:44 -0700, Shane pisze: Hi All, I am using SA within TurboGears. When saving data from form fields, I often have a dict of key/value pairs (where values is always a string and must by correctly typed) where each key is set up to correspond to a column

[sqlalchemy] Re: Auto-generated Code?

2009-10-23 Thread Tefnet Developers - Tomasz Jezierski
Dnia 2009-10-23, Pt o godzinie 15:00 +0800, Stone Puzzle pisze: Is there a way or lib to help us generating python code of all of the tables and relations automatically from a existing database? http://turbogears.org/2.1/docs/main/Utilities/sqlautocode.html Tomasz Jezierski Tefnet

[sqlalchemy] Re: Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-19 Thread Tefnet Developers
Dnia 2009-10-08, czw o godzinie 11:16 -0400, Michael Bayer pisze: Tefnet Developers wrote: Dnia 2009-10-08, czw o godzinie 09:59 -0400, Michael Bayer pisze: Is this a SQLAlchemy bug or my mistake? Backrefs deal with the two-way relation between A-B, but the event does

[sqlalchemy] using ORM in AttributeExtension

2009-10-19 Thread Tefnet Developers
Hi, and here comes another problem with my project utilizing SQLAlchemy :). I am trying to use ORM in AttributeExtension: (http://dpaste.com/109454/) = import sqlalchemy import sqlalchemy.ext.declarative Base =

[sqlalchemy] Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-08 Thread Tefnet Developers
Hello, I am having a problem here - at one point a one-to-many relation attribute is not in sync with a backref one (http://dpaste.com/104225/): # Fails with Python-2.5.4 and SQLAlchemy-0.5.5 or SQLAlchemy-rel_0_5 rev 6312 import sqlalchemy import sqlalchemy.ext.declarative class

[sqlalchemy] Re: Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-08 Thread Tefnet Developers
Dnia 2009-10-08, czw o godzinie 13:49 +0200, Christoph Zwerschke pisze: By the way, you don't need to use a meta class in your example; you can simply set manager = sqlalchemy.orm.relation( 'Employee', backref='subordinates', remote_side=Id) I needed it for other stuff so

[sqlalchemy] Re: Synchronization problem at backref of a one-to-many relation to the same class.

2009-10-08 Thread Tefnet Developers
Dnia 2009-10-08, czw o godzinie 09:59 -0400, Michael Bayer pisze: Is this a SQLAlchemy bug or my mistake? Backrefs deal with the two-way relation between A-B, but the event does not propagate in most cases to C or beyond, i.e. A-B-C where B is attached to A would indicate C-B becomes

[sqlalchemy] support for set/replace on a collection in AttributeExtension

2009-10-02 Thread Tefnet Developers
Hi, I need to get a single event at an extension in case of such operation: obj.colAttr = [x, y, z] right now I will receive: extension.remove(...) for each value currently in colAttr extension.append(...) for x, y and z. what I need is something like: extension.replace(oldvalues, values)

[sqlalchemy] Re: Problem with defining relations between inherited classes

2009-08-28 Thread Tefnet Developers
Dnia 2009-08-27, czw o godzinie 10:51 -0400, Michael Bayer pisze: you can also set up primaryjoin using the actual table columns (i.e. PhysObject.locationId == Location.__table__.c.id). Thanks, that worked really well :). Now i am stuck with something else in this subject:

[sqlalchemy] Problem with defining relations between inherited classes

2009-08-27 Thread Tefnet Developers
Hi, I have a problem with such program (available at http://filip.math.uni.lodz.pl/relation_problem.py): = Fails with Python-2.5.4 and SQLAlchemy-0.5.5 import sqlalchemy import sqlalchemy.ext.declarative ''' This program

[sqlalchemy] Re: Attribute inheritance problem.

2009-07-29 Thread Tefnet Developers
Dnia 2009-07-28, wto o godzinie 11:06 -0400, Michael Bayer pisze: A few things here. First is, I'm not observing the extension not getting inherited. Task().result = 3 raises the error, DeliveryTask().result = 3 does not, and the value is assigned to 3. This is with 0.5.5 as well as

[sqlalchemy] Re: Attribute inheritance problem - IRC comment

2009-07-29 Thread Tefnet Developers
A short discussion from #sqlalchemy at freenode: [09:48] filip hi, could somebody please run http://filip.eu.org/sqlawtf.py and tell me whether an exception is being raised? [09:49] filip because on my machines it is, and on zzzeek's it is not... [09:55] stepz_ filip: I looked at that a

[sqlalchemy] Attribute inheritance problem.

2009-07-28 Thread Tefnet Developers
Hi all, i have a problem with attribute inheritance as seen here: # Fails with Python-2.5.4 and SQLAlchemy-0.5.5 # There is happening something very strange, which causes DeliveryTask.result not to cover Task.result even though