[sqlalchemy] image field in mssql

2013-06-12 Thread alex bodnaru
hello friends, i'm happily using sa, both with a declarative/elixir orm, and directly through DBSession.execute(text statement). there is an issue that works great with orm, but i don't khown how to achieve in direct execution: image fields. i'm inserting the data as: sql = insert

Re: [sqlalchemy] Dabo ReportDesigner/Writer

2013-06-12 Thread Werner
Hi, On 04/06/2013 08:26, Werner wrote: Hi, I am looking at Dabo's ReportDesigner/Writer to do reporting (looked at others like PythonReports and Geraldo) but both have problems with large text blobs. It wants the data as: Dabo's reportwriter wants dataset-like structures, which is a

Re: [sqlalchemy] [Q][0.7.9] All scoped sessions use ONE DB connection

2013-06-12 Thread Ladislav Lenart
Correction. It was cherrypy's fault. It uses 'implicit' locking of web sessions by default ('tools.sessions.locking'). We changed it to 'explicit' and call web_session.acquire_lock() / web_session.release_lock() manually when we need to. This works like a charm! HTH, Ladislav Lenart On

Re: [sqlalchemy] Feature suggestion: fake ForeignKeyConstraints to simplify joins

2013-06-12 Thread Charlie Clark
Am 11.06.2013, 23:47 Uhr, schrieb Andy aml...@gmail.com: I could do that, but I'd change the foreign key in favorites to point at group_things, since your favorite group must be a group that you're in. Then I'd drop the other foreign key constraint as unnecessary, since it's implied by the new

Re: [sqlalchemy] image field in mssql

2013-06-12 Thread Michael Bayer
blobs are problematic, and this is often highly dependent on DBAPI version and platform. So can you send along details: 1. python version 2. operating system 3. SQLAlchemy version 4. DBAPI in use, version I can give it a test on this end. On Jun 12, 2013, at 6:00 AM, alex bodnaru

Re: [sqlalchemy] Dabo ReportDesigner/Writer

2013-06-12 Thread Michael Bayer
On Jun 12, 2013, at 7:17 AM, Werner werner.bru...@sfr.fr wrote: Hi, On 04/06/2013 08:26, Werner wrote: Hi, I am looking at Dabo's ReportDesigner/Writer to do reporting (looked at others like PythonReports and Geraldo) but both have problems with large text blobs. It wants the data

Re: [sqlalchemy] Dabo ReportDesigner/Writer

2013-06-12 Thread Werner
Hi Michael, On 12/06/2013 17:40, Michael Bayer wrote: ... Will give me the column value of Container_LV.name, I tried using with_labels but it doesn't seem to affect the __dict__ keys. When I look at: row.keys() ['id', 'name', 'name'] This is with SA 0.8.1. in that situation you need

Re: [sqlalchemy] self-referential one to many relationship with a kind of composite foreign key

2013-06-12 Thread Michael Bayer
Well for proxies you'd need to roll part of it manually, like a custom collection that filters, that kind of thing. But no matter. I'll apologize up front you don't get the hear the raucous cackle I made when I got this to work. Because it required heading down the dusty stairs to unlock

Re: [sqlalchemy] image field in mssql

2013-06-12 Thread alex bodnaru
hello michael, as usually, you were faster than me to answer. after reviewing my surrounding code to fix additional bugs there, i've just found the answer: a bytearray is needed as sql param. i've built the buffer from an image with BytesIO. im = Images.new() image = BytesIO() im.save(image)

[sqlalchemy] Related object not updating on flush, only on commit

2013-06-12 Thread Robert Buchholz
Hello, today I've been bit again by a one-to-many relation not updating when its underlying foreign key changed. This feels inconsistent, especially since its behavior depends on whether the relationship was referenced before the change or not. A reduced example is attached, with comments /

[sqlalchemy] SqlAlchemy use in Twisted threads

2013-06-12 Thread writes_on
I'm building a Twisted application in Python 2.7 and am trying to use SqlAlchemy to interact with the database. I've got a working application that is leaking memory, and am not sure how to find the leaks. As a maybe this is the problem I'm asking if how I'm using SqlAlchemy might be the

Re: [sqlalchemy] self-referential one to many relationship with a kind of composite foreign key

2013-06-12 Thread Greg Yang
Oh wow, haha, this is pretty awesome. Never thought I'd use mapper by itself at all! Thanks a lot! I guess the ancient technique is still useful for something, eh On Wednesday, June 12, 2013 11:36:21 AM UTC-5, Michael Bayer wrote: Well for proxies you'd need to roll part of it manually, like

[sqlalchemy] sqlacodegen 1.1.1 released

2013-06-12 Thread Alex Grönholm
This is a bugfix release. Issues resolved: - Fixed TypeError when inflect could not determine the singular name of a table for a many-to-1 relationship - Fixed _IntegerType, _StringType etc. being rendered instead of proper types on MySQL -- You received this message because

Re: [sqlalchemy] SqlAlchemy use in Twisted threads

2013-06-12 Thread Michael Bayer
On Jun 12, 2013, at 2:47 PM, writes_on doug.farr...@gmail.com wrote: I'm building a Twisted application in Python 2.7 and am trying to use SqlAlchemy to interact with the database. I've got a working application that is leaking memory, and am not sure how to find the leaks. As a maybe this

Re: [sqlalchemy] SqlAlchemy use in Twisted threads

2013-06-12 Thread Richard Gerd Kuesters
I've been dealing with Twisted since the beggining of my ages with Python :) What I can say: it's not an easy job. Here's what I see working: 1. Use Twisted Perspective Brokers to do the database job for you, AFAIK is the most used combination of Twisted + SQA; 2. Use other types of message

Re: [sqlalchemy] SqlAlchemy use in Twisted threads

2013-06-12 Thread Michael Bayer
I'm looking forward to Pep3156 (http://www.python.org/dev/peps/pep-3156/) finally producing a working integration between Twisted and Gevent. Or whatever Nick Coghlan wants to come up with, since he among anyone has the most crossover knowledge of the async / ORM-related worlds I've seen.

Re: [sqlalchemy] SqlAlchemy use in Twisted threads

2013-06-12 Thread Richard Gerd Kuesters
That's cool. I made some tests with a GeventReactor with SQLAlchemy and the psycopg green implementation. The results were ~20% faster in almost all benchs I made, but I didn't tested them in production yet. On 06/12/2013 05:48 PM, Michael Bayer wrote: I'm looking forward to Pep3156

Re: [sqlalchemy] Feature suggestion: fake ForeignKeyConstraints to simplify joins

2013-06-12 Thread Andy
On Wednesday, June 12, 2013 7:52:27 AM UTC-7, Charlie Clark wrote: Am 11.06.2013, 23:47 Uhr, schrieb Andy aml...@gmail.com javascript:: I could do that, but I'd change the foreign key in favorites to point at group_things, since your favorite group must be a group that you're in. Then

[sqlalchemy] mapper property creation is a bit too magically deferred

2013-06-12 Thread Andy
I just got really confused. I have code that does ...join(schema.MappedClass.relation), and it works. But I had other code that did foo = schema.MappedClass.relation, and it didn't work because 'relation' wasn't there. The fix is to call orm.configure_mappers(), which happens by magic at

Re: [sqlalchemy] mapper property creation is a bit too magically deferred

2013-06-12 Thread Michael Bayer
On Jun 12, 2013, at 8:46 PM, Andy aml...@gmail.com wrote: I just got really confused. I have code that does ...join(schema.MappedClass.relation), and it works. But I had other code that did foo = schema.MappedClass.relation, and it didn't work because 'relation' wasn't there. The fix