[sqlalchemy] Re: Duplicate entry '0' for key 'PRIMARY'

2023-09-21 Thread Martin Parrag
Hi All! Crisis reverted, turned out my database column didn't have the autoincerement flag. Sorry for the topic. Martin Parrag a következőt írta (2023. szeptember 21., csütörtök, 16:53:14 UTC+2): > Hi Guys! > > I have ORMs with autoincrement primary keys, and I'd like to achive a &

[sqlalchemy] Duplicate entry '0' for key 'PRIMARY'

2023-09-21 Thread Martin Parrag
Hi Guys! I have ORMs with autoincrement primary keys, and I'd like to achive a multiple insert with sqlalchemy. I'm making a lot of objects and adding them to the session, and after I'm done, I'd like to make session.commit() but then I get this error: (MySQLdb.IntegrityError) (1062,

Re: [sqlalchemy] Soft Delete Pattern

2023-07-03 Thread Andrew Martin
ng_query/filter_public.html > > > On Mon, Jul 3, 2023, at 11:13 PM, Andrew Martin wrote: > > Hello, > > I have a base class I tend to use that includes a Boolean is_deleted field > so that pretty much every object has that available. > > Is there a good pattern fo

[sqlalchemy] Soft Delete Pattern

2023-07-03 Thread Andrew Martin
Hello, I have a base class I tend to use that includes a Boolean is_deleted field so that pretty much every object has that available. Is there a good pattern for setting a filter on these objects that automatically adds a WHERE is_deleted = 'false'? Or does that just have to be added as a

Re: [sqlalchemy] Session management for general functions within a class

2022-04-29 Thread Andrew Martin
eady > belongs to. > > Hope that helps, > > Simon > > On Fri, Apr 29, 2022 at 5:10 AM Andrew Martin wrote: > >> Hi all, I'm struggling a bit with best practices for my ETL application. >> >> Each part of the ETL app is completely separate from the others, but

[sqlalchemy] Session management for general functions within a class

2022-04-28 Thread Andrew Martin
Hi all, I'm struggling a bit with best practices for my ETL application. Each part of the ETL app is completely separate from the others, but I have a MixIn for some common functions that each of them need to do, like move this record to error if there's a data integrity problem. Or move this

[sqlalchemy] Idiomatic way to track state during ETL processing

2022-02-28 Thread Andrew Martin
I haven't found any topics here that address this, so it may mean that the answer is so simple that I'm just overthinking here. Context: I'm the lone developer on a new tech team at a company that's never had any team in place before. Everything is greenfield. Which is great because I get to

[sqlalchemy] Comparing an SQLAlchemy object to a similar object

2021-04-10 Thread Andrew Martin
Hi everyone, This might be a totally premature optimization, but I want to at least start off in the right direction. I'm pulling messages from a slack channel into an Airflow DAG and writing events to a table if certain attributes of the slack message has changed. Slack message structures

Re: [sqlalchemy] Generic File Loader issue with Booleans

2020-10-28 Thread Andrew Martin
I will reproduce this when I get done with work this evening and give the specifics. On Wednesday, October 28, 2020 at 7:46:26 AM UTC-5, Mike Bayer wrote: > > > > On Tue, Oct 27, 2020, at 11:56 PM, Andrew Martin wrote: > > This is probably a weirdly specific question, but

[sqlalchemy] Generic File Loader issue with Booleans

2020-10-27 Thread Andrew Martin
This is probably a weirdly specific question, but I have a workflow that involves loading lots of CSVs into Postgres. Some of them are very large, so I want to cut overhead and not use CSV Dictreader. Wanted to use named tuples instead. Here's a header and a line from a file:

Re: [sqlalchemy] Problem with prescribed polymorphism solution

2020-03-03 Thread Isaac Martin
be considered to > be bugs with concrete inheritance but I don't have any solution for them > right now. > > (also make sure you set up back_populates on your mutually-dependent > relationships) > > Since concrete inheritance is documented as being very buggy (see dragon > at

[sqlalchemy] Problem with prescribed polymorphism solution

2020-03-03 Thread Isaac Martin
SQLalchemy prescribes a pattern for dealing with polymorphic relationships which are one to many. You can see this pattern here: https://docs.sqlalchemy.org/en/13/orm/extensions/declarative/api.html#sqlalchemy.ext.declarative.AbstractConcreteBase After implementing this pattern I was pleased to

[sqlalchemy] Re: Regarding Data type consideration

2019-08-18 Thread Andrew Martin
Hi Mohan, Could you give us some more information about the structure of your Dataframe and how you are using SqlAlchemy? On Sunday, August 18, 2019 at 4:24:09 AM UTC-5, Mohan Raj wrote: > > Hi, > > I used "sqlalchemy" in my python code for inserting a Dataframe from > Pandas(0.25.0) to

[sqlalchemy] use sqlalchemy model to generate avro schema

2019-07-22 Thread Isaac Martin
Hey folks! I have a sqlalchemy model. I would like to define interaction between services as being constrained by a contract. For that contract, I wish to use avro schema. It would be nice to be able to generate new schema when I change the sqlalchemy model. Is anyone aware of a library or

Re: [sqlalchemy] How to inspect filters

2019-06-27 Thread Andrew Martin
past the block, that way I'm not so surprised by answer that Mike and people like you give me. Anyway, probably TMI. Cheers and thanks! On Thu, Jun 27, 2019 at 11:09 AM Jonathan Vanasco wrote: > > > On Wednesday, June 26, 2019 at 2:43:44 PM UTC-4, Andrew Martin wrote: >> >> Th

Re: [sqlalchemy] How to inspect filters

2019-06-26 Thread Andrew Martin
That's very interesting, Jonathan. Could you show me a quick example of that approach? I'm not sure I *need* to do that, but I think I would learn about SQLAlchemy from such an example and trying to understand it. On Wed, Jun 26, 2019 at 11:00 AM Jonathan Vanasco wrote: > FWIW, I found a better

Re: [sqlalchemy] How to inspect filters

2019-06-25 Thread Andrew Martin
Thank you, as always, for both the specific answer and the general advice. Much appreciated! On Sunday, June 23, 2019 at 5:19:49 PM UTC-5, Mike Bayer wrote: > > > > On Sun, Jun 23, 2019, at 5:45 PM, Andrew Martin wrote: > > I have a generic CRUDService for my web a

[sqlalchemy] How to inspect filters

2019-06-23 Thread Andrew Martin
I have a generic CRUDService for my web app. It's a pattern that was loosely suggested to me by Mike a while back. I've probably not implemented it the way he intended, but it works pretty well in a pretty small amount of code. The main work, however, that needs to be done is in the read_all

Re: [sqlalchemy] Re: Better Implementation of Query Mixin?

2019-03-24 Thread Andrew Martin
parent and you then > refactor. > > e.g. don't overplan ahead, do it stupidly simple then expect to > refactor a few times.but also don't create state where it isnt > needed, if that makes sense. > > > On Sat, Mar 23, 2019 at 11:24 AM Andrew Martin > wrote: >

Re: [sqlalchemy] Re: Better Implementation of Query Mixin?

2019-03-23 Thread Andrew Martin
refactor. > > e.g. don't overplan ahead, do it stupidly simple then expect to > refactor a few times.but also don't create state where it isnt > needed, if that makes sense. > > > On Sat, Mar 23, 2019 at 11:24 AM Andrew Martin > wrote: > > > >

[sqlalchemy] Re: Better Implementation of Query Mixin?

2019-03-23 Thread Andrew Martin
Martin wrote: > > I like to keep my models separate from actions on it, so I only use them > for defining tables, relationships, and indexes. To perform actions on a > model I use a service that inherits from the model and provides . . . well. > services. It's an interface patt

[sqlalchemy] Better Implementation of Query Mixin?

2019-03-23 Thread Andrew Martin
I like to keep my models separate from actions on it, so I only use them for defining tables, relationships, and indexes. To perform actions on a model I use a service that inherits from the model and provides . . . well. services. It's an interface pattern. I'm making these more generic, and

Re: [sqlalchemy] Re: Polymorphic Query All regardless of subclass

2019-03-01 Thread Andrew Martin
at, I don't have > a pressing need to figure out the other way you were doing it if you > dont. > > > On Fri, Mar 1, 2019 at 12:23 PM Andrew Martin > wrote: > > > > Thanks for the reply, Mike. I should've offered the SQL equivalent of > what I was going for to

[sqlalchemy] Re: Polymorphic Query All regardless of subclass

2019-03-01 Thread Andrew Martin
to grab the whole dataset in that format. Thanks! On Thursday, February 28, 2019 at 12:34:16 PM UTC-6, Andrew Martin wrote: > > Hi All, > > Trying something out here for an analytics app here, and I'm not sure any > of this is a good idea. I'm trying to create a data model

[sqlalchemy] Polymorphic Query All regardless of subclass

2019-02-28 Thread Andrew Martin
Hi All, Trying something out here for an analytics app here, and I'm not sure any of this is a good idea. I'm trying to create a data model that's flexible enough to handle a lot of different types of analysis. From plain CSVs to time series to survey questions with complex hierarchies. My

Re: [sqlalchemy] Compiling to Postgres VALUES clause with bindparam

2019-02-11 Thread Martin Stein
ds .NET Core because of this, SQLAlchemy is the one library that singlehandedly keeps me in the Python world, because it's so amazing. Am Freitag, 8. Februar 2019 18:03:20 UTC+1 schrieb Mike Bayer: > > On Fri, Feb 8, 2019 at 10:05 AM Martin Stein > wrote: > > > > Am Donnerst

Re: [sqlalchemy] Compiling to Postgres VALUES clause with bindparam

2019-02-08 Thread Martin Stein
Am Donnerstag, 7. Februar 2019 23:45:09 UTC+1 schrieb Mike Bayer: > > > > note the mentioned issue is closed. IN supports an inline parameter now: > > https://docs.sqlalchemy.org/en/rel_1_2/orm/extensions/baked.html#baked-in > > We had started using the .op('IN') approach around v1.1 and I

Re: [sqlalchemy] Column.copy() omits ForeignKeys and Constraints

2019-01-10 Thread Martin Haass
Thanks! I didn't see that line. I try to compile an example tomorrow. While working on https://github.com/sqlalchemy/alembic/pull/526 it was necessary to duplicate column object with foreign_keys Regards, Martin On Thursday, 10 January 2019 16:05:42 UTC+1, Mike Bayer wrote: > > On Thu,

[sqlalchemy] Column.copy() omits ForeignKeys and Constraints

2019-01-10 Thread Martin Haass
of contradicts the column.,copy method which writes constraints and foreign_keys into kwargs that are passed to the constructor (lines 1492) The duplicated column objects in my case lack the foreign_keys Thx Martin -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http

[sqlalchemy] Re: Finding table dependencies in a selectable

2018-10-26 Thread Philip Martin
uot; if drop.if_exists: text += "IF EXISTS " text += compiler.preparer.format_table(drop.element) if drop.cascade: text += " CASCADE" return text On Thursday, October 25, 2018 at 2:58:59 PM UTC-5, Philip Martin wrote: > > I am trying to cre

[sqlalchemy] Finding table dependencies in a selectable

2018-10-25 Thread Philip Martin
I am trying to create a function that finds the dependent tables used in a select-able statement. My plan is to use this function in conjunction with *t.add_is_dependent_on* inside a modified version of the recipe to create views. Hopefully, this allows *sorted_tables* to use these dependency

[sqlalchemy] Re: View DDL Statements with Parameters in Select Statement

2018-10-09 Thread Philip Martin
ober 9, 2018 at 9:07:03 PM UTC-5, Philip Martin wrote: > > I am attempting to use Sqlalchemy to build views along the table and > schema DDL statements. In mainly relied on the view recipe wiki with a > couple modifications to build logic for view DDL statements. I've included > thi

[sqlalchemy] View DDL Statements with Parameters in Select Statement

2018-10-09 Thread Philip Martin
I am attempting to use Sqlalchemy to build views along the table and schema DDL statements. In mainly relied on the view recipe wiki with a couple modifications to build logic for view DDL statements. I've included this code inside my gist

Re: [sqlalchemy] Implementing historical tables

2018-01-31 Thread Martin Marrese
Hi Stanislav, Perhaps a way to avoid using `save` and `add_new` custom methods is to rely on listeners, perhaps `after_update` and `after_insert` will let you create historical records in some place else. A couple of years ago I achieved this with SQLAlchemy Continuum (1), but I'm not sure in

Re: [sqlalchemy] Re: Server side column triggers

2017-11-01 Thread Philip Martin
) On Wednesday, November 1, 2017 at 6:51:00 PM UTC-7, Mike Bayer wrote: > > On Wed, Nov 1, 2017 at 9:45 PM, Philip Martin > <philip.m...@gmail.com > wrote: > > Wow. Must have completely missing this in the docs. Thank you for the > > sample, it definitely ha

Re: [sqlalchemy] Re: Server side column triggers

2017-11-01 Thread Philip Martin
s up but since you > are linking to a mixin, __declare_first__ is the simplest, but needs > the configure_mappers() step to happen for it to be called. > > also your function recipe needs a @compiles, I'm assuming you got that > from the documentation example. > > > > > On

[sqlalchemy] Re: Server side column triggers

2017-10-31 Thread Philip Martin
I was trying to embed the reference code, but here is the link to the gist <https://gist.github.com/pmart123/b6681e9d9c6ddc92582143e13c1c6941> I have so far. On Tuesday, October 31, 2017 at 7:46:30 PM UTC-7, Philip Martin wrote: > > > I am attempting to create an audit mixin ob

[sqlalchemy] Server side column triggers

2017-10-31 Thread Philip Martin
I am attempting to create an audit mixin object that would use a server side column trigger to set the updated_at timestamp. Ideally, whenever a class inherits from a declarative base and this mixin class, the trigger statement would be created after the table is created and dropped prior to

[sqlalchemy] Re: Postgres database: open and close connection

2017-10-06 Thread Martin Cigorraga
Hello Simon, Jonathan TYVM for your feedback, I'll try your recommendations! -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See

[sqlalchemy] Postgres database: open and close connection

2017-10-06 Thread Martin Cigorraga
Hi, I'm trying to create a simple function to check the reachability of a Postgres database using the http method GET; if the connection can't be established, it should respond with a custom http error number. This is what I got so far: https://pastebin.com/rh3t6nYN Being fairly new to Python

Re: [sqlalchemy] Database Type Attributes

2017-09-14 Thread Philip Martin
output.append((attribute, value)) return output On Thursday, September 14, 2017 at 2:37:03 PM UTC-5, Mike Bayer wrote: > > On Thu, Sep 14, 2017 at 10:49 AM, Philip Martin > <philip.m...@gmail.com > wrote: > > We have several third-party vendors that provide us

[sqlalchemy] Database Type Attributes

2017-09-14 Thread Philip Martin
We have several third-party vendors that provide us with large, normalized schema (100+) tables. I am looking to quickly discover probable foreign keys based on a column's name and data type attributes. For the data type attributes, I am looking to extract any attribute values set on the data

[sqlalchemy] CTE's with Inserts and Delete

2017-09-12 Thread Philip Martin
My goal is to produce a query that would incrementally refresh new data via a upsert (insert new data or replace if conflict with primary key) and a delete query to remove any primary keys that no longer exist. I am using Postgres 9.6 and Sqlalchemy 1.1. For a simple example in SQL I

[sqlalchemy] Re: LIMIT the number of children in relationship dynamically

2017-05-02 Thread Isaac Martin
Yep, I ended up doing exactly what you describe. Thanks again! > > -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve

Re: [sqlalchemy] LIMIT the number of children in relationship dynamically

2017-05-02 Thread Isaac Martin
to trying subqueries like this myself in the future. On Mon, May 1, 2017 at 9:38 PM, Isaac Martin <melchoi...@gmail.com> wrote: > Thank you very much for your response. This solution isn't working for me, > and I'm 99% sure I'm not translating what you've written into something > t

Re: [sqlalchemy] LIMIT the number of children in relationship dynamically

2017-05-01 Thread Isaac Martin
ew information then I'd really appreciate it. If I figure out what I was doing wrong I'll post here for posterity. On Mon, May 1, 2017 at 7:34 PM, mike bayer <mike...@zzzcomputing.com> wrote: > > > On 05/01/2017 08:05 PM, Isaac Martin wrote: > >> >> I am building an a

[sqlalchemy] LIMIT the number of children in relationship dynamically

2017-05-01 Thread Isaac Martin
I am building an api which can return children of resources if the user requests it. For example, user has messages. I want the query to be able to limit the number of message objects that are returned. I found a useful tip about limiting the number of objects in child collections here

[sqlalchemy] Bad context when trying to joinedload model's relationship

2017-03-24 Thread Martin Latrille
u need to evaluate the bug? NB: everytime this happens (which is not often), I just have to restart the server and it works. Guess it is just bad data memoized at setup time. Thanks for reading, Martin -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.

[sqlalchemy] sqlalchemy polymorphism without discriminators

2017-03-20 Thread Isaac Martin
down votefavorite I am trying to use an external library which defines a class model in my own program. I want the classes I define to be the same in all respects to their parents from the library,

[sqlalchemy] Re: Best use of engine_from_config

2016-09-04 Thread Andrew Martin
Also, do be clear, what I have works. I'm passing the request object to the model and then creating the engine based on the request. It works, but I have a nagging feeling that this is not good and definitely not best. On Sunday, September 4, 2016 at 10:39:55 AM UTC-4, Andrew Martin wrote

Re: [sqlalchemy] Best use of engine_from_config

2016-09-04 Thread Andrew Martin
that dictionary instead of creating it with each > request. > > On Sun, Sep 4, 2016 at 4:39 PM, Andrew Martin <agmar...@gmail.com > <mailto:agmar...@gmail.com>> wrote: > I have a question about using creating engines along with pretty much any > python we

[sqlalchemy] Best use of engine_from_config

2016-09-04 Thread Andrew Martin
I have a question about using creating engines along with pretty much any python web framework, but I'm specifically working with Pyramid. For obvious reasons. :) The sqlalchemy docs state this: "The typical usage of create_engine()

[sqlalchemy] Adding a shutdown session to the documentation

2016-06-28 Thread Martin Häcker
(): # do something to access the db and is nicely explicit and raises otherwise. We'd like to open source this (~100 loc + tests) perhaps as part of sqlalchemy or the wiki? What do you think, would this be useful to somebody? Best regards, Martin Häcker -- You received this message because

[sqlalchemy] bulk_update_mapping stale data error

2016-05-03 Thread Andrew Martin
This is an admittedly wonky situation. And I don't have much code to offer because I think the problem is conceptual on my part, rather than code-related. We're basically using google spreadsheets as a quick and dirty interface for certain types of data entry. I know how terrible this is.

Re: Configure version_locations dynamically

2016-01-20 Thread Martin Marrese
On Fri, Jan 8, 2016 at 8:09 PM Mike Bayer wrote: > the general idea here is to make your own Alembic command runner, create > a Config dynamically and then invoke the alembic commands via > alembic.command.foo() from that. > > Mike, Thanks for the answer. I'm going to

[sqlalchemy] Creating New Tables from SQL DDL Components

2015-12-27 Thread Philip Martin
I am integrating a new data source that provides schema data and versioning in text files. The schema is comprised of several sub-schemas, and overall, contains over 250+ tables. The data model is actually very good, with lots of skinny tables/normalized properly. The schema dialect for data

Re: [sqlalchemy] (OperationalError) no such column when child class uses different name for primary key in polymorphic relationship and a subselect issued

2015-11-23 Thread Martin Pengelly-Phillips
Thanks Michael. On Saturday, 21 November 2015 22:35:14 UTC, Michael Bayer wrote: > > > > On 11/20/2015 12:20 PM, Martin Pengelly-Phillips wrote: > > Hi there, > > > > Using SQLAlchemy 1.0.9 > > > > I am dealing with some legacy code and came a

[sqlalchemy] (OperationalError) no such column when child class uses different name for primary key in polymorphic relationship and a subselect issued

2015-11-20 Thread Martin Pengelly-Phillips
base unfortunately. I have found a workaround by using a synonym, but wanted to report the issue to see if the failure is expected and there is a requirement for the primary key field names to match or not. cheers, Martin -- You received this message because you are subscribed to the Google

Re: [sqlalchemy] Domain models and "leaky abstractions"

2015-11-13 Thread Martin Marrese
On Fri, Nov 13, 2015 at 9:57 AM, Yegor Roganov wrote: > Simon, thanks for your reply. > > As I said, I'm not sure that this can be solved on the ORM-level, rather > I'm interested in how others solve similar issues. In a small project it's > possible to remember what each

[sqlalchemy] Access foreign key value after collection modification before flush

2015-07-18 Thread Martin Pengelly-Phillips
' of node before flush if possible. Is there a way to configure that behaviour or should I be creating my own collection listeners to handle this? cheers, Martin -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group

[sqlalchemy] Table Views

2015-03-26 Thread Philip Martin
I am beginning to familiarize myself with basic concept in sqlalchemy. One question I am still trying to wrap my head around is creating a table view. In terms of the problem I am trying to solve, I am trying to setup schemas particularly related to financial reference data. The data doesn't

[sqlalchemy] ORM Instance field validation

2014-12-09 Thread Martin Marrese
/kyheo/af2a333b850e6eb2fa93 are some of the tests I've done. But still not sure if I'm taking the right approach for the fields validation, and still haven't found a way to test state_id field. Any hep, hint or direction to the proper doc page will be appreciated. Thanks, Martín -- Martin A. Marrese

[sqlalchemy] Automatic close of ResultProxy (using with statement)

2013-10-13 Thread Martin Stettner
I'm using SqlAlchemy core to access my database. I'm just wondering if there's a specific reason why the ResultProxy class doesn't implement the __enter__ and __exit__ methods for automatically closing the results of a query using Python's with statement. This would make the following code

Re: [sqlalchemy] dynamic schema with postgresql

2013-09-15 Thread Joe Martin
Thank you for your kind help; it was really helpful. On Fri, Sep 13, 2013 at 2:40 AM, Michael Bayer mike...@zzzcomputing.comwrote: On Sep 11, 2013, at 10:36 PM, Joe Martin jandos...@gmail.com wrote: Thank you for your reply. Then I thought the following would work

Re: [sqlalchemy] dynamic schema with postgresql

2013-09-11 Thread Joe Martin
original metadata I was able to create both tables: app.company and public.customer. So, I'm confused with the issue. Thanks for your time. On Wed, Sep 11, 2013 at 11:25 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Sep 10, 2013, at 11:48 PM, Joe Martin jandos...@gmail.com wrote: I

[sqlalchemy] dynamic schema with postgresql

2013-09-10 Thread Joe Martin
I need to create a new schema with some tables in it whenever a new company record is added. Below are my entities (defined with Flask-SqlAlchemy framework extension): class Company(db.Model): __tablename__ = 'company' __table_args__ = {schema:app} id = db.Column(db.Integer,

[sqlalchemy] Using expire_on_commit with autocommit

2013-03-26 Thread Martin Davidsson
often find myself having to expire objects manually so it would be nice to use expire_on_commit=True. My question is, is this warning still accurate? expire_on_commit makes it sound pretty clear when something expires so I don't know if it agrees with the documentation. Thanks! -- Martin

[sqlalchemy] Problem with __declare_last__ and inheritance

2013-03-12 Thread peeters . martin
mappers, but actually both methods triggers the after_configured event. Did you have any clue to avoid that error ? Thanks Martin -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails from it, send

[sqlalchemy] Re: Column order with declarative base and @declared_attr

2011-07-21 Thread Hans-Martin
of a nuisance than a real problem, it only really affects browsing through the tables after all. Thanks, Hans-Martin -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe

[sqlalchemy] Status of executed update

2011-06-09 Thread Martin
Hi, I have a question: Is it possible to get the information if an SQL Update was successful from the Result-Proxy returned from executing the update statement: result = connection.execute (update.where (pk_column == pk)) Thanks, Martin -- You received this message because you

[sqlalchemy] Re: Python 3.1 + SQLAlchemy 0.6 or 0.7

2011-03-30 Thread Hans-Martin
is the latest version of py3k and actually has some fairly dramatic behavioral differences vs. 3.1.   If you want to work with 3.2 and let us know what quirks you find... Below is one (Python 3.2, sqlalchemy 0.7b4 (downloaded snapshot 10min ago), Debian). Best wishes, Hans-Martin Traceback (most

[sqlalchemy] Re: Python 3.1 + SQLAlchemy 0.6 or 0.7

2011-03-30 Thread Hans-Martin
None I have a working setup with 2.7 + 0.6.6, but would like to port it to 3.2 relatively soon -- if I can help trying out things, just let me know. Best wishes, Hans-Martin -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send

[sqlalchemy] Re: Python 3.1 + SQLAlchemy 0.6 or 0.7

2011-03-30 Thread Hans-Martin
On Mar 30, 5:43 pm, Michael Bayer mike...@zzzcomputing.com wrote: That's not an error I'm familiar with how to reproduce; it suggests an incorrect string passed to create_engine().   Working code with Python 3.2 plus pg8000 looks like: from sqlalchemy import create_engine e =

[sqlalchemy] Re: Python 3.1 + SQLAlchemy 0.6 or 0.7

2011-03-30 Thread Hans-Martin
you'd need an @ sign in there perhaps: db://@/test Same error. But no big deal, I can wait for psycopg2 support in Python 3.2. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com. To

[sqlalchemy] Re: Python 3.1 + SQLAlchemy 0.6 or 0.7

2011-03-30 Thread Hans-Martin
On Mar 30, 7:13 pm, Michael Bayer mike...@zzzcomputing.com wrote: well its not going to work there either most likely since we don't support connecting without a hostname, probably.  You can't put localhost in there ? Doesn't work either, same error. Adding my system username (and password)

[sqlalchemy] Re: ResourceClosedError with large Text columns

2011-03-18 Thread Martin
The test case fails. Filed as a MySQLdb bug at https://sourceforge.net/tracker/?func=detailaid=3223245group_id=22307atid=374932 Cheers, Martin On Mar 17, 6:18 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Mar 17, 2011, at 9:11 PM, Martin wrote: I have a table with a Text column, which

[sqlalchemy] ResourceClosedError with large Text columns

2011-03-17 Thread Martin
. sqlalchemy.exc.ResourceClosedError: This result object does not return rows. It has been closed automatically. I googled for the exception type and description, but nothing useful came up. Does anyone have an idea what's going wrong here? Cheers, Martin -- You received this message because you are subscribed

Re: [sqlalchemy] Failing test - SQLAlchemy 0.5.8, python 2.7.0

2010-12-07 Thread Martin Bacovsky
for tracking purposes): http://pkgs.fedoraproject.org/gitweb/?p=python-sqlalchemy0.5.git;a=blob;f=python-sqlalchemy0.5- py27.patch;h=6946e846f1430bb9d7dc1137eea9afa8e7eb822e;hb=HEAD If anyone has less awkward solution, please let me know. Regards, Martin On Nov 24, 2010, at 8:17 PM, Martin Bacovsky

[sqlalchemy] Failing test - SQLAlchemy 0.5.8, python 2.7.0

2010-11-24 Thread Martin Bacovsky
that there was also test failing on @profiling.function_call_count which I fixed by adding expected numbers for python 2.7. But I don't expect it is related. Regards, Martin nosetests

Re: [sqlalchemy] Failing test - SQLAlchemy 0.5.8, python 2.7.0

2010-11-24 Thread Martin Bacovsky
in the tests. Regards, Martin On Nov 24, 2010, at 7:06 PM, Martin Bacovsky wrote: Hi, I'm trying to build SqlAlchemy 0.5.8 (Linux, python 2.7.0). From time to time some of the tests fail. - the sources are always the same - so far the only affected tests were those testing compilation

Re: [sqlalchemy] Re: one to many relation, removing and adding list issue

2010-08-26 Thread Martin-Leon Francois
: Any suggestion helping solving this? On 25 août, 13:02, Martin-Leon Francois francois@gmail.com wrote: Hi, I am trying in the same session to detach an instance from a collection ( one to many) flush and commit everything (all is ok) and then attach the removed instance again

Re: [sqlalchemy] Re: one to many relation, removing and adding list issue

2010-08-26 Thread Martin-Leon Francois
ok, many thx fma Le 26 août 2010 à 17:03, Michael Bayer a écrit : On Aug 26, 2010, at 8:49 AM, Martin-Leon Francois wrote: hi, The problem seems to be a little bit more general, I have a unique class (doing nothing) mapped to a unique table. After opening a session, I create

[sqlalchemy] one to many relation, removing and adding list issue

2010-08-25 Thread Martin-Leon Francois
Hi, I am trying in the same session to detach an instance from a collection ( one to many) flush and commit everything (all is ok) and then attach the removed instance again. unsuccessfully. in below code, last assert fails. I don't understand why I am not able to append m2 to o1.to_many

[sqlalchemy] How to influence tables ordering during create_all()

2010-05-11 Thread Martin Bacovsky
are the flaws in my plan, I have to be prepared for? Regards, Martin Bacovsky -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy

Re: [sqlalchemy] How to influence tables ordering during create_all()

2010-05-11 Thread Martin Bacovsky
On Tuesday 11 May 2010 17:43:29 Michael Bayer wrote: On May 11, 2010, at 11:32 AM, Martin Bacovsky wrote: Hi all, I need to add support for db views in our project. I'm limited to SA 0.5 at the moment and need the views to be included during create_all/drop_all calls. I followed

[sqlalchemy] get(..)-query in single-table inheritance

2010-03-08 Thread Martin Stein
inconsistent to me: Sometimes you get None; and sometimes (when the manager is already present in the session) you get the manager instance. Is this intended behavior or a bug? Test case below... Cheers and thanks, Martin from sqlalchemy import * from sqlalchemy.orm import

[sqlalchemy] Re: get(..)-query in single-table inheritance

2010-03-08 Thread Martin Stein
If you view the .get(1) as conceptually similar to query(cls).filter_by(employee_id=1).all() then None would make sense. That's the way I've seen it so far. If you look at get(..) as a different concept, then an exception seems reasonable. Should I file a ticket when the trac box is up again?

[sqlalchemy] Postgres INHERITS and concrete table inheritance

2009-12-15 Thread Martin Aspeli
and VehicleBus results in an error (the Owner object already has an 'owners' field) I feel like I may've missed something here, though. Any suggestions on how to do this better? Cheers, Martin -- Author of `Professional Plone Development`, a book for developers who want to work with Plone. See http

[sqlalchemy] Re: Postgres INHERITS and concrete table inheritance

2009-12-15 Thread Martin Aspeli
Hi Michael, Thanks for the quick reply! Michael Bayer wrote: Martin Aspeli wrote: Hi, This kind of works, but there are a few problems: - The 'owners' variable on the Game type only contains Vehicle objects. I'd like it to contain the correct sub-class if possible. When a row

[sqlalchemy] How do I execute Oracle custom functions?

2009-08-14 Thread Nick Martin
Hi, I've been trying to get my head around how to call custom functions in Oracle. In straight SQL it would usually be: exec blah.fishcakes(1); Where blah is the package name, and fishcakes the name of the function. For stored procedures I've tried doing: mqry =

[sqlalchemy] Re: Unnecessary join in eager one-to-many backref

2009-08-04 Thread Martin Stein
of eagerload() for queries where you know you'll want to descend that deeply. Okay, I've created the enhancement ticket and I'll check out the eagerload() way for the short term. Thanks for your help! Cheers, Martin --~--~-~--~~~---~--~~ You received this message

[sqlalchemy] Unnecessary join in eager one-to-many backref

2009-08-03 Thread Martin Stein
). In this case, the join is unnecessary, since the parent object is already known. Is there something I am missing or a way to avoid the join? Cheers and thanks, Martin Simple test case: from sqlalchemy import * from sqlalchemy.orm import mapper, sessionmaker, relation, backref engine

[sqlalchemy] is_backref circular cloning

2009-03-19 Thread Martin
I've written my own deep_clone for SA Object Trees, which is exploiting quite some lowlevel calls inside SA This has brought me to reimplement the cloning for every major version change, I started in 0.3, updated to 0.4 with some major rework, but I simply cant get it to work with 0.5.2, and I

[sqlalchemy] Re: Sorting by related property

2009-03-19 Thread Martin
I guess q = session.query(A).join('b').order_by(B.code).all() should do the trick, at least it did under 0.4.8 Martin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send

[sqlalchemy] 0.5.2 is_backref property circular cloning

2009-03-19 Thread Martin
I've written my own deep_clone for SA Object Trees, which is exploiting quite some lowlevel calls inside SA This has brought me to reimplement the cloning for every major version change, I started in 0.3, updated to 0.4 with some major rework, but I simply cant get it to work with 0.5.2, and I

[sqlalchemy] Re: 0.5.2 is_backref property circular cloning

2009-03-19 Thread Martin
, UNIQUE contraints, and lets me specify properties, that should not be set hmmm, Martin On Mar 19, 3:16 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Mar 19, 2009, at 10:13 AM, Martin wrote: there surely must be an easier way to do a deep clone of everything except session/SA data

[sqlalchemy] Re: 0.5.2 is_backref property circular cloning

2009-03-19 Thread Martin
gotcha, thanks :) btw, love SA, one of the reasons i use pylons when I can and not Django, Martin On Mar 19, 4:00 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Mar 19, 2009, at 10:39 AM, Martin wrote: I dont see it, especially since from the docs: When given an instance

[sqlalchemy] Re: is_backref circular cloning

2009-03-19 Thread Martin
Thanks for the answers, actually this thread-head-post had been deleted, sorry for the duplicate threads and now dangling replies in this one, Martin On Mar 19, 3:11 pm, a...@svilendobrev.com wrote: this clone stuff comes over and over and over... i have similar .copy() in dbcook

[sqlalchemy] Problem sending imap iterator to Session.execute

2009-02-06 Thread Kevin Martin
I am migrating from SA 0.4 to SA 0.5.2 and I am having some problems. I am using the orm session object and issuing raw sql commands in some cases for performance reasons. Take the following example. I have a few hundred thousand tuples that will become new rows in 'mytable'. I want to issue a

[sqlalchemy] Custom Comparator with order_by

2008-06-06 Thread Martin Pengelly-Phillips
Hi there, Quick question - is it possible to get a custom comparator to work with order_by? At present my code based on SA/examples/vertical/dictlike- polymorphic.py raises a NotImplementedError when attempting to use the value in an order_by statement. ta, Martin --- q

  1   2   >