[sqlalchemy] Recreating Access in LibreOffice Base

2020-10-22 Thread 'Tom Potts' via sqlalchemy
I used to find MS Access to be a very useful tool in the right hands. I've been doing some python script coding in LibreOffice Base and started looking at sqlalchemy it looks as if it wouldnt be too much of a job to add the components necessary to turn LO Base front end into something not far

Re: [sqlalchemy] Using the same joinedload object in multiple options causes performance issue with baked queries

2018-06-07 Thread Tom Flannaghan
mappings would be helpful to > confirm this fixed the issue. > > On Wed, Jun 6, 2018 at 10:32 AM, Tom Flannaghan > wrote: > > Thanks Mike. I've attached a script that shows the difference in case > that > > helps. > > > > -- > > SQLAlchemy - &

Re: [sqlalchemy] Using the same joinedload object in multiple options causes performance issue with baked queries

2018-06-06 Thread Tom Flannaghan
Thanks Mike. I've attached a script that shows the difference in case that helps. -- 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] Using the same joinedload object in multiple options causes performance issue with baked queries

2018-06-06 Thread Tom Flannaghan
this (and a mention of this issue in the docs). Thanks, Tom -- 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 for a full description

[sqlalchemy] Re: KeyError when looping thru class objects to try and copy them

2017-12-20 Thread Tom Tanner
I moved `db.session.commit()` outside the loop. That seemed to fix the error. I'll post an update if I get more errors. On Wednesday, December 20, 2017 at 6:43:05 PM UTC-5, Lele Gaifax wrote: > > Tom Tanner <dontsende...@gmail.com > writes: > > > I want to query row

[sqlalchemy] KeyError when looping thru class objects to try and copy them

2017-12-20 Thread Tom Tanner
I want to query rows and copy them while changing an attribute of each. Here's my code. colObjs= db.session.query(Column).filter_by(chart_id=oldChartID).all() for colObj in colObjs: make_transient(colObj) print colObj.id del colObj.id colObj.chart_id= newChartID

[sqlalchemy] Re: How do I copy an object and save to database?

2017-12-20 Thread Tom Tanner
Thank you On Wednesday, December 20, 2017 at 8:37:57 AM UTC-5, Lele Gaifax wrote: > > Tom Tanner <dontsende...@gmail.com > writes: > > > Lele, could you write the code showing how that would look? Thanks. > > Extending Mike's answer: > > from sql

[sqlalchemy] Re: How do I copy an object and save to database?

2017-12-20 Thread Tom Tanner
Lele, could you write the code showing how that would look? Thanks. On Wednesday, December 20, 2017 at 2:22:49 AM UTC-5, Lele Gaifax wrote: > > Tom Tanner <dontsende...@gmail.com > writes: > > > Thanks, I used the first method. Follow up question: How do I get the > ne

Re: [sqlalchemy] How do I copy an object and save to database?

2017-12-19 Thread Tom Tanner
Thanks, I used the first method. Follow up question: How do I get the new primary key after running `session.commit()`? On Tuesday, December 19, 2017 at 11:29:34 AM UTC-5, Mike Bayer wrote: > > On Tue, Dec 19, 2017 at 3:02 AM, Tom Tanner > <dontsende...@gmail.com > wrote:

[sqlalchemy] How do I copy an object and save to database?

2017-12-19 Thread Tom Tanner
I'm using SQLAlchemy with the Python library Flask. How do I query an object from a database, make a copy of it, and save that copy to the database? Example of querying an object. someObj = db.session.query(SomeDataTable).filter_by(id=someID).first() I want to save a copy of `someObj` to the

[sqlalchemy] could not translate host name

2017-02-24 Thread Tom Ekberg
ils on db2. Any ideas on how to proceed? Tom -- 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 for a full description

Re: patterns for automated tests of migrations

2016-11-23 Thread Tom Lazar
the `metadata.create_all` feature and then normalize the results and compare. if there is a mismatch the test fails. if you want to write more elaborate tests involving actual data, this should be a good starting point, though HTH, tom > On 23 Nov 2016, at 10:15, Chris Withers <ch...@simplistix.co.uk&

Is there a way to generate DDL of current state as of a revision?

2016-09-22 Thread Tom Walter
I work in a team of people collaborating on database development and we'd like to start version controlling and deploy our changes with Alembic. I was wondering though if there is a way to generate the DDL for the current state of the whole schema as of a given revision... something like the

Re: [sqlalchemy] How to define relationship in inherited declarative class?

2016-08-21 Thread Tom Kedem
Bayer wrote: > > > > On 08/21/2016 10:22 AM, Tom Kedem wrote: > > It seems I confused "concrete" with "joined" inheritance. > > > > What I want to achieve is /joined/ inheritance. I've modified the code > > to reflect that (just removed all c

Re: [sqlalchemy] How to define relationship in inherited declarative class?

2016-08-21 Thread Tom Kedem
I still get an error saying it doesn't recognize super_user as a child of user. On Sunday, August 21, 2016 at 6:37:19 AM UTC+3, Mike Bayer wrote: > > > > On 08/20/2016 08:27 PM, Tom Kedem wrote: > > I suppose I could have a discriminator value for "function type", but

Re: [sqlalchemy] How to define relationship in inherited declarative class?

2016-08-20 Thread Tom Kedem
ong in my configuration or understanding? On Saturday, August 20, 2016 at 10:44:24 PM UTC+3, Mike Bayer wrote: > > This doesn't look like a concrete mapping, you have a foreign key from > SuperUser to User. Are you sure this isn't supposed to be an ordinary > joined inheritance model

[sqlalchemy] How to define relationship in inherited declarative class?

2016-08-20 Thread Tom Kedem
I have the following setup (attached python file). I'm using an inheritance hierarchy without a discriminator field, deriving from AbstractBase. I want to be able to use the "keywords" attribute in the "SuperUser" class, and from the documentation I understand I need to redefine it, however that

[sqlalchemy] Re: Creating declared class in __declare_first__ causes RuntimeError: deque mutated during iteration

2016-08-17 Thread Tom Kedem
, August 15, 2016 at 4:38:34 PM UTC+3, Tom Kedem wrote: > > I'm trying to create a dynamic many_to_many relationship, inspired by: > http://techspot.zzzeek.org/2011/05/17/magic-a-new-orm/ > > https://bitbucket.org/zzzeek/pycon2014_atmcraft/src/f50cbe745a19/atmcraft/model/meta/?at=maste

[sqlalchemy] Re: Creating declared class in __declare_first__ causes RuntimeError: deque mutated during iteration

2016-08-15 Thread Tom Kedem
ing iteration I'm not sure it's flask-sqlalchemy's issue, but it's related to it. Looking at their base class creation I don't notice anything "funny", but I'm probably overlooking something. On Monday, August 15, 2016 at 4:38:34 PM UTC+3, Tom Kedem wrote: > > I'm trying to create a dynamic

Re: [sqlalchemy] Creating declared class in __declare_first__ causes RuntimeError: deque mutated during iteration

2016-08-15 Thread Tom Kedem
something > that should be made to work. That is, perhaps declarative should use a > different system internally for the __declare_first__ in order to get > around this. > > > > On 08/15/2016 09:38 AM, Tom Kedem wrote: > > I'm trying to create a dynam

Re: [sqlalchemy] Re: executemany() incorrectly used for updates to a table with row versioning with psycopg2

2015-10-20 Thread Tom Flannaghan
Hi Mike, Your fix worked - the example I gave and our other tests pass now. Many thanks, Tom On Mon, 19 Oct 2015 at 17:19 Mike Bayer <mike...@zzzcomputing.com> wrote: > > > On 10/19/15 11:57 AM, Mike Bayer wrote: > > > > > > On 10/19/15 11:44 AM, Steven Winfi

[sqlalchemy] executemany() incorrectly used for updates to a table with row versioning with psycopg2

2015-10-19 Thread Tom Flannaghan
Hi, We are currently trying to upgrade to sqlalchemy 1.0.8 and have hit a problem with executemany() and row versioning. We are using postgres and psycopg2 as a backend. We have tables that use server side versioning (as discussed at

Re: [sqlalchemy] Columns not deferred when an object is merged into a session with load=False

2015-07-17 Thread Tom Flannaghan
Thanks a lot! This works well. Tom On Thu, 16 Jul 2015 at 21:23 Mike Bayer mike...@zzzcomputing.com wrote: On 7/16/15 2:28 PM, Tom Flannaghan wrote: Thanks for your reply. Our exact problem is that we are creating empty detached objects from the primary key alone, and then merging them

[sqlalchemy] Columns not deferred when an object is merged into a session with load=False

2015-07-16 Thread Tom Flannaghan
object directly rather than expunging one from the session and the problem still occurs, so it seems to be caused by the load=False option. Thanks, Tom -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop

Re: [sqlalchemy] Columns not deferred when an object is merged into a session with load=False

2015-07-16 Thread Tom Flannaghan
(detached_port, load=False) ... In my example, Port only has two columns so this won't demonstrate the bug as the only non-deferred column is filled in already, but more complicated objects that are merged in this way will not defer columns. Do you think there a work around in this case? Thanks, Tom

[sqlalchemy] How to determine if a session has any uncommitted changes

2014-10-09 Thread Tom Dalton
(): raise SessionLeftUnclean() Any and all help gratefully appreciated! Regards, Tom -- 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 an email to sqlalchemy+unsubscr

Re: [sqlalchemy] How to determine if a session has any uncommitted changes

2014-10-09 Thread Tom Dalton
On Thursday, 9 October 2014 16:51:49 UTC+1, Michael Bayer wrote: On Oct 9, 2014, at 6:09 AM, Tom Dalton tom.d...@fanduel.com javascript: wrote: Using SQLAlchemy 0.9. I am writing a server, that's running in gevent. As part of the library code, I am trying to write a session

Re: [sqlalchemy] How to determine if a session has any uncommitted changes

2014-10-09 Thread Tom Dalton
to handle/be careful of? Thanks a lot for your help! Tom On 9 October 2014 17:42, Michael Bayer mike...@zzzcomputing.com wrote: On Oct 9, 2014, at 12:16 PM, Tom Dalton tom.dal...@fanduel.com wrote: Thanks for the reply. I saw the session transaction events stuff but I'm not sure that they help

Re: Delete class in model and downgrade, bulk_insert

2014-03-17 Thread Tom Haulitschke
So, create a Table, use that, make sure you’re sending the right kinds of objects to bulk_insert(). Thank you very much for that very quick reply, this did the trick. The try/except blocks in my post above were just to show what I've tried so far. I'll include my working code so that it

[sqlalchemy] Re: postgresql emulating app engines list property

2012-06-13 Thread Tom Willis
I went ahead and asked this on stackoverflow if anyone would like to have a stab at it. http://stackoverflow.com/questions/11021020/emulating-appengine-list-property-with-postgresql-array-and-sqlalchemy On Tuesday, June 12, 2012 7:34:42 AM UTC-4, Tom Willis wrote: Hello, I'm hoping

Re: [sqlalchemy] Re: postgresql emulating app engines list property

2012-06-13 Thread Tom Willis
? On Jun 13, 2012, at 2:24 PM, Tom Willis wrote: I went ahead and asked this on stackoverflow if anyone would like to have a stab at it. http://stackoverflow.com/questions/11021020/emulating-appengine-list-property-with-postgresql-array-and-sqlalchemy On Tuesday, June 12, 2012 7:34:42

Re: [sqlalchemy] Re: postgresql emulating app engines list property

2012-06-13 Thread Tom Willis
with psycopg2 directly. If you can get it to work with psycopg2 alone, passing the desired value as a bound parameter, then we can work out what the type engine needs to do or not. On Jun 13, 2012, at 3:07 PM, Tom Willis wrote: Well I had written another type to emulate appengines Key, basically

[sqlalchemy] postgresql emulating app engines list property

2012-06-12 Thread Tom Willis
Hello, I'm hoping that some of the functionality I actually like in appengine datastore can be duplicated in postgresql via sqlalchemy. However I'm not quite grokking how all the moving pieces for a dialect(if that's the right term) fit together. On appengine there are list properties or

[sqlalchemy] sqlite custom queries failing in 0.7.6

2012-03-22 Thread Tom Kralidis
VALUES(2,'bar'); COMMIT; sqlite Any idea on how to support this approach in both 0.6 and 0.7? Thanks for any advice. ..Tom -- 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] custom Python functions as part of SQL queries

2011-06-01 Thread Tom Kralidis
do this?) I hope I have explained this well enough for some suggestions and / or workarounds. Thanks ..Tom -- 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 from

[sqlalchemy] InternalError: current transaction is aborted, commands ignored until end of transaction block...

2010-09-29 Thread tom
not even sure it has to do with Sqlalchemy (I'm using version 0.5.8, with Postgres). Any pointers in the right direction would be greatly appreciated. - Tom -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email

[sqlalchemy] Re: InternalError: current transaction is aborted, commands ignored until end of transaction block...

2010-09-29 Thread tom
that rollback is called automatically anytime a commit fails, but I'm not so sure anymore. On Sep 29, 4:07 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Sep 29, 2010, at 7:13 AM, tom wrote: Hey, I'm applying finishing touches to my web app before rolling it out, when this strange error

[sqlalchemy] Re: InternalError: current transaction is aborted, commands ignored until end of transaction block...

2010-09-29 Thread tom
Thank you very much, that was very helpful! On Sep 29, 5:27 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Sep 29, 2010, at 11:03 AM, tom wrote: First, thanks for that quick answer, that explains it. I turned autocommit on, and it works again. That leads me to this question: I do

[sqlalchemy] Re: cascading a delete in a many-to-many relation

2010-07-14 Thread tom
That was indeed my problem, thank you very much! But I still cannot wrap my brain around cascading, if anyone has a link to a good writeup I'd be glad. --tom On Jul 13, 12:51 am, Conor conor.edward.da...@gmail.com wrote: On 07/12/2010 02:38 PM, tom wrote: Hi, I have a problem

[sqlalchemy] predefined,dynamic query

2010-01-11 Thread tom
,multiple tables, private-user's tables) efficiently and without letting the user be aware of implementaion. anyone? :) thanks tom -- 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

[sqlalchemy] String to Column Type Conversion

2009-11-23 Thread Tom Burdick
understand how I could do what I want with pure introspection like I do now. -Tom -- 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

[sqlalchemy] Re: String to Column Type Conversion

2009-11-23 Thread Tom Burdick
Ok, here's a small test. It actually works fine when using sqlite, but not when using postgresql. I want it to work with postgresql! This probably helps more than the description above. http://www.pylonshq.com/pasties/fe6a2857f3f72d499914caabce0d41bc -Tom On Nov 23, 10:33 am, Tom Burdick

[sqlalchemy] Adding new columns to a table

2009-08-11 Thread tom
, if I modify an existing column, eg. from Column('subject', String (128)) to Column('subject', String(128), default='(no subject)'), and then do create_all, nothing changes. Is create_all the wrong thing to do there, or where am I going wrong? Regards, Tom

[sqlalchemy] Re: Adding method to ORM mapped object

2009-08-11 Thread tom
From what I see, you forgot the self argument in the getRendered function definition. def getRendered(self): return '%s\n%s' % (self.title, self.content) On Aug 10, 5:00 am, Andreas andr...@flausch.at wrote: Arghh... I got it. The problem was that I wasn't querying through a session,

[sqlalchemy] Re: 0.5.3 ORM, MSSQL and FreeTDS: Invalid Cursor State exception?

2009-05-01 Thread Tom Wood
on a separate system (Debian again.) -Tom On Apr 30, 11:06 pm, mtrier mtr...@gmail.com wrote: On Apr 30, 11:04 pm, mtrier mtr...@gmail.com wrote: Some additional info, and a possible fix: === --- lib/sqlalchemy/databases

[sqlalchemy] Re: 0.5.3 ORM, MSSQL and FreeTDS: Invalid Cursor State exception?

2009-04-30 Thread Tom Wood
Hi Lucas, I don't think #1350 applies here, but just in case, I pass-ed out the mssql dialect do_begin per the suggestion in the discussion thread referenced by that ticket: no impact on the invalid cursor state exception. -Tom Can you read over this ticket and see if maybe you

[sqlalchemy] 0.5.3 ORM, MSSQL and FreeTDS: Invalid Cursor State exception?

2009-04-27 Thread Tom Wood
the same results or not! :-) FYI: The test succeeds using SQLAlchemy 0.5.0rc3, but fails with every subsequent release. It also passes running against a sqllite db. Thanks very much. Tom Wood University of Connecticut # begin test code import sqlalchemy as sa from sqlalchemy import orm conn

[sqlalchemy] Re: 0.5.3 ORM, MSSQL and FreeTDS: Invalid Cursor State exception?

2009-04-27 Thread Tom Wood
with no relations) do succeed. -Tom On Apr 27, 12:18 pm, Lukasz Szybalski szybal...@gmail.com wrote: On Mon, Apr 27, 2009 at 10:01 AM, Tom Wood thomas.a.w...@gmail.com wrote: Hi all, Am having a problem with SQLAlchemy 0.5.3 and MSSQL.  Running on a Debian stack, using FreeTDS 0.82, pyodbc

[sqlalchemy] Re: column name capitalization in mysql

2008-10-28 Thread Tom H
Corrected in r5204. http://www.sqlalchemy.org/trac/changeset/5204 Ticket details: http://www.sqlalchemy.org/trac/ticket/1206 -Tom H On Oct 27, 4:35 pm, Tom H [EMAIL PROTECTED] wrote: Thanks Michael, I posted a new ticket at:http://www.sqlalchemy.org/trac/ticket/1206 Best Regards, -Tom H

[sqlalchemy] Re: column name capitalization in mysql

2008-10-27 Thread Tom H
Thanks Michael, I posted a new ticket at: http://www.sqlalchemy.org/trac/ticket/1206 Best Regards, -Tom H On Oct 27, 4:13 pm, Empty [EMAIL PROTECTED] wrote: Tom, On Mon, Oct 27, 2008 at 4:03 PM, Tom H [EMAIL PROTECTED] wrote: I'm experiencing the following problem with SA 0.4.7

[sqlalchemy] mysql, use password from my.cnf file

2008-09-29 Thread Tom H
Depending on security preferences, it may be desirable to keep database passwords out of code files. One of the recommendations for MySQL is to keep the password in a .my.cnf file accessible only to the user. http://dev.mysql.com/doc/refman/5.0/en/password-security.html To use the .my.cnf

[sqlalchemy] SA4: Why the automatic rollback on exception during SQL-Expression execution?

2008-09-22 Thread Tom Moertel
shed some light, I would be grateful. Thanks for your help! Cheers, Tom --~--~-~--~~~---~--~~ 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] Re: SA4: Why the automatic rollback on exception during SQL-Expression execution?

2008-09-22 Thread Tom Moertel
Michael, thanks for your quick and helpful response. For any new project, I would strongly urge the usage of 0.5... Our project isn't new, but I think it's time to move to SA 0.5. :-) Cheers, Tom --~--~-~--~~~---~--~~ You received this message because you

[sqlalchemy] Re: relation with same class/table on both sides

2008-07-09 Thread Tom Hogarty
The manager and direct reports example was just what my project needed. I'm looking forward to upgrading to 0.5 in the future so that I don't have to enter redundant primaryjoin and secondaryjoin on the backref. Thank you Mike! On Jun 28, 1:10 am, Tom Hogarty [EMAIL PROTECTED] wrote: Wow

[sqlalchemy] do not load large binary column but make available on demand

2008-07-09 Thread Tom Hogarty
Hello, I have a table that stores binary file data in one column and information about the file (file name, mime type, sha1 sum, etc) in the other columns. Currently when I use the mapped class, it loads the file data (adds to network and memory load). What I would like to do is check the sha1

[sqlalchemy] Re: do not load large binary column but make available on demand

2008-07-09 Thread Tom Hogarty
Deferred column loading is exactly what I needed, thanks Rick! Coming from a pure SQL background I'm starting to get familiar with all this new ORM and SQLAlchemy terminology. It's worth it though, the code is so much cleaner and more maintainable than stringing together huge complicated SQL

[sqlalchemy] relation with same class/table on both sides

2008-06-27 Thread Tom Hogarty
hints on how I can do this. I have other basic relations working (1-1, 1-M, M-1) but they all have different classes/tables on each end of the relation. Regards, -Tom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: relation with same class/table on both sides

2008-06-27 Thread Tom Hogarty
Wow, thank you very much for the detailed example. It looks like just what I need. I look forward to trying it out very soon. -Tom On Jun 27, 6:12 pm, Michael Bayer [EMAIL PROTECTED] wrote: this relation will require you to configure primaryjoin and   secondaryjoin (it should be raising

[sqlalchemy] Re: allow_column_override

2008-06-17 Thread Tom Hogarty
Thanks for the info, I had the same problem and was able to fix it by renaming my relation to not override the other one and turning off allow_override. Removing allow_column_override would help eliminate the confusion since replacing the column makes the relation not work without the

[sqlalchemy] Re: Oracle, limit, and polymorphism

2008-02-04 Thread Tom Torsney-Weir
-Original Message- From: sqlalchemy@googlegroups.com sqlalchemy@googlegroups.com To: sqlalchemy sqlalchemy@googlegroups.com Sent: Mon Feb 04 16:09:49 2008 Subject: [sqlalchemy] Oracle, limit, and polymorphism Hey all, I'm rather new to sqlalchemy, I've been playing with it for about a

[sqlalchemy] Re: Oracle, limit, and polymorphism

2008-02-04 Thread Tom Torsney-Weir
-Original Message- From: sqlalchemy@googlegroups.com sqlalchemy@googlegroups.com To: sqlalchemy sqlalchemy@googlegroups.com Sent: Mon Feb 04 16:09:49 2008 Subject: [sqlalchemy] Oracle, limit, and polymorphism Hey all, I'm rather new to sqlalchemy, I've been playing with it for about a

[sqlalchemy] Re: Oracle, limit, and polymorphism

2008-02-04 Thread Tom Torsney-Weir
-Original Message- From: sqlalchemy@googlegroups.com sqlalchemy@googlegroups.com To: sqlalchemy sqlalchemy@googlegroups.com Sent: Mon Feb 04 16:09:49 2008 Subject: [sqlalchemy] Oracle, limit, and polymorphism Hey all, I'm rather new to sqlalchemy, I've been playing with it for about a