[sqlalchemy] best way of connecting to sqlserver from linux using SA?

2012-03-05 Thread Chris Withers
Hi All, What's now the best way to connect to a Microsoft SQL Server instance from a linux box? What's the recommended driver? cheers, Chris -- Simplistix - Content Management, Batch Processing Python Consulting - http://www.simplistix.co.uk -- You received this message

Re: [sqlalchemy] Id and id

2012-03-05 Thread Martijn Moeling
Michael, Thank you for confirming my worries and adding reason to it. I'm not sure if you remember al my questions in the past but with my project I'm constantly hitting the impossible, although its fun, it can be frustrating sometimes. What I'm doing is something bigger than just an

Re: [sqlalchemy] best way of connecting to sqlserver from linux using SA?

2012-03-05 Thread Timuçin Kızılay
On 05-03-2012 11:29, Chris Withers wrote: Hi All, What's now the best way to connect to a Microsoft SQL Server instance from a linux box? What's the recommended driver? cheers, Chris I'm using pyodbc and freetds packages to connect to existing mssql server 2008 running on windows.

Re: [sqlalchemy] Id and id

2012-03-05 Thread Martijn Moeling
I think I've got it working correctly. in my mixin I now do: @declared_attr def id(self): return ExtColumn('JSid',Unicode(255), default = None) so the id property is actually stored in the DB Column 'JSid' Since my introspection looks at the python class, it takes the name

Re: [sqlalchemy] Id and id

2012-03-05 Thread Michael Bayer
On Mar 5, 2012, at 6:52 AM, Martijn Moeling wrote: I think I've got it working correctly. in my mixin I now do: @declared_attr def id(self): return ExtColumn('JSid',Unicode(255), default = None) so the id property is actually stored in the DB Column 'JSid' Since

[sqlalchemy] Proxy objects and SA joined inheritance

2012-03-05 Thread Pete Erickson
Is is possible to set the polymorphic_on attribute on an object that is not directly tied to a db table, but has access to the db attribute via delegation? I have a generic Product class that processes an XML to obtain its generic attributes (uuid, type, etc). Afterwards, the product is

[sqlalchemy] One to Many relationship of the same class as the parent class

2012-03-05 Thread Stefan
I have been struggeling for a few days with this now and trying to see if I maybe can get some help here. I'm using SQLAlchemy with Flask This is what I have tried so far: I got a user class defined like this: association_table = db.Table('association', db.Column('user_id', db.Integer,

[sqlalchemy] Re: One to Many relationship of the same class as the parent class

2012-03-05 Thread Stefan
I managed to figure this one out my self :) association_table = db.Table('association', db.Column('user_id', db.Integer, db.ForeignKey('user.id')), db.Column('friend_id', db.Integer, db.ForeignKey('user.id')) ) class User(db.Model): id = db.Column(db.Integer, primary_key=True)

[sqlalchemy] Object delegation and SA inheritance

2012-03-05 Thread Peter Erickson
Is is possible to set the polymorphic_on attribute on an object that is not directly tied to a db table, but has access to the db attribute via delegation? I have a generic Product class that processes an XML to obtain its generic attributes (uuid, type, etc). Afterwards, the product is

Re: [sqlalchemy] Id and id

2012-03-05 Thread Martijn Moeling
I have seen it in the docs and that is where the solution came from. When not interested in a property I tend to remember it is there but not read into it, which is normal I guess.. I was looking at some commented out code in that bit and saw I had tried name='JSid' but since name was used in

Re: [sqlalchemy] Object delegation and SA inheritance

2012-03-05 Thread Michael Bayer
On Mar 3, 2012, at 10:03 AM, Peter Erickson wrote: Is is possible to set the polymorphic_on attribute on an object that is not directly tied to a db table, but has access to the db attribute via delegation? I have a generic Product class that processes an XML to obtain its generic

Re: [sqlalchemy] Reducing instrumentation overhead for read-only entities

2012-03-05 Thread Andrey Popp
Hello, just for the record, I've built a quick and dirty hack[1] which simplifies state-management for immutable domain models (can create but can't modify). Achieved 2-2.5x speedup in pickle/unpickle (see tests module). I'm not just suggesting anyone to use this in production (though I already

Re: [sqlalchemy] Reducing instrumentation overhead for read-only entities

2012-03-05 Thread Claudio Freire
On Sun, Feb 19, 2012 at 6:27 AM, Andrey Popp 8may...@gmail.com wrote: I've managed quite efficient inlining with bytecode magic. It's especially effective with SQLA code, since it also specializes the inlined function, removing a lot of dead code (in the call context). That's pretty

Re: [sqlalchemy] Reducing instrumentation overhead for read-only entities

2012-03-05 Thread Andrey Popp
On Mon, Mar 05, 2012 at 06:20:33PM -0300, Claudio Freire wrote: On Sun, Feb 19, 2012 at 6:27 AM, Andrey Popp 8may...@gmail.com wrote: I've managed quite efficient inlining with bytecode magic. It's especially effective with SQLA code, since it also specializes the inlined function, removing

Re: [sqlalchemy] Reducing instrumentation overhead for read-only entities

2012-03-05 Thread Michael Bayer
Wow, OK great, you were able to make something work while maintaining the ClassManager approach. So the first thing is, you can skip the redefinition of Mapper(). You can put your custom ClassManager class right on a base or mixin class like this: class MySpecialMixin(object):

[sqlalchemy] Re: Object delegation and SA inheritance

2012-03-05 Thread Pete Erickson
Thanks for the response, however sorry that I posted the question twice. I had some computer problems over the weekend and didn't think that my original email made it through. On Mar 5, 2:52 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Mar 3, 2012, at 10:03 AM, Peter Erickson wrote: I

Re: [sqlalchemy] Re: Object delegation and SA inheritance

2012-03-05 Thread Michael Bayer
On Mar 5, 2012, at 9:33 PM, Pete Erickson wrote: book, and there is no BookProduct. That being the case, I'd still like the generic Product to persist, but it just won't have additional attributes specific to a book. Once the BookProduct is created, I can go back and fix it... so the question

Re: [sqlalchemy] orm query that returns millions of rows

2012-03-05 Thread Chris Withers
On 02/03/2012 15:59, Michael Bayer wrote: the other recipe is the windowed range query which I normally use for this at http://www.sqlalchemy.org/trac/wiki/UsageRecipes/WindowedRangeQuery, So, this would be the way to go for Microsoft SQL Server? cheers, Chris -- Simplistix - Content