[sqlalchemy] Declared Attribute Inheritance Not Working As Expected?

2018-10-05 Thread Victor Reichert
Hi, I have a mixin like: class BasicSqlClass(object): @declared_attr def __tablename__(cls): return convert(cls.__name__) + 's The mixin declares the table name and does other stuff. Hover, there is a class where I wanted to overwrite the mixed-in __tablename__ by declaring

[sqlalchemy] A review of querying/searching and mutability tracking on Postgres SQL JSON and JSONB field implementations using SQLAlchemy and Sqlalchemy-Json

2018-06-28 Thread Victor Reichert
Hi, I've been trying to better understand the properties of different Postgres JSON field implementations. I wrote s script with my tests and I thought I would share it. It can be found at: https://gist.github.com/vfr292/41530bfb56778ffc26fe53c605f40feb FWIW, I found implementing the field

Re: [sqlalchemy] When gets flagged as mutated with postgresql JSONB column?

2018-06-26 Thread Victor Reichert
at 1:01:06 PM UTC-7, Mike Bayer wrote: > > On Tue, Jun 26, 2018 at 3:56 PM, Victor Reichert > > wrote: > > Hi, > > > > I have a class like: > > > > class SQLClass(db): > > > > json_field = Column(sqlalchemy.dialects.postgresql.JSONB) &g

[sqlalchemy] When gets flagged as mutated with postgresql JSONB column?

2018-06-26 Thread Victor Reichert
Hi, I have a class like: class SQLClass(db): json_field = Column(sqlalchemy.dialects.postgresql.JSONB) I'm doing something like: session.add( SQLClass(json_field = dict( key = [value1] ) )) session.commit() slq_class_obj = session.query(SQLClass).first() new_dict =

Re: [sqlalchemy] Eager Loading of AssociationProxy (Generic Association with Discriminator on Association)

2014-11-24 Thread Victor Reichert
, at 1:00 AM, Victor Reichert vfr...@gmail.com javascript: wrote: I've taken another look at trying to eager load the address.parent. Is it possible to do that? Unfortuntately not really. It should be in theory but I’m not able to work out an eager load that goes to both Customer

Re: [sqlalchemy] Eager Loading of AssociationProxy (Generic Association with Discriminator on Association)

2014-11-24 Thread Victor Reichert
I should add the final version of my file ist at: https://gist.github.com/vfr292/3330037cf5bc621d3d4b should anyone want to reference it. Thank you again Mr. Bayer! On Monday, November 24, 2014 11:00:06 PM UTC-8, Victor Reichert wrote: Thank you! You are not an SQL alchemist, you are a SQL

Re: [sqlalchemy] Eager Loading of AssociationProxy (Generic Association with Discriminator on Association)

2014-11-23 Thread Victor Reichert
sqlalchemy.exc.ArgumentError: mapper option expects string key or list of attributes Any advice on how I can eager load address.parent would be much appreciated :) Sincere thanks, ~Victor On Sunday, October 26, 2014 3:06:13 AM UTC-7, Michael Bayer wrote: On Oct 26, 2014, at 12:07 AM, Victor Reichert vfr...@gmail.com

Re: [sqlalchemy] Eager Loading of AssociationProxy (Generic Association with Discriminator on Association)

2014-10-28 Thread Victor Reichert
and make them eager loaded? Thank you again :) ~Victor On Sunday, October 26, 2014 3:06:13 AM UTC-7, Michael Bayer wrote: On Oct 26, 2014, at 12:07 AM, Victor Reichert vfr...@gmail.com javascript: wrote: Hi, I am following the Generic Association with Discriminator on Association example

[sqlalchemy] Eager Loading of AssociationProxy (Generic Association with Discriminator on Association)

2014-10-25 Thread Victor Reichert
Hi, I am following the Generic Association with Discriminator on Association example at: http://docs.sqlalchemy.org/en/latest/_modules/examples/generic_associations/discriminator_on_association.html However, I would like to eager load the customer.addresses in a query like eager_sales_persons

[sqlalchemy] Active Record/Rails Polymorphic in SqlAlchemy is a Generic Association

2014-10-21 Thread Victor Reichert
Hi, I had been struggling to find how to implement a generic association and the documentation for inherited polymorphic relationships wasn't really helping. After some (a lot) of searching I found some great examples of how to implement what I was looking for. An example of the Rails

[sqlalchemy] Misleading warning for SqlAlchemy?

2014-09-11 Thread Victor Reichert
Hi, I'm using flask-sqlahcmey and I have a self referential relationship like this: class FileData(db.Model): id = db.Column(db.Integer, primary_key = True) primary_file_data_id = db.Column(db.Integer, ForeignKey('file_data.id')) is_edited_file = db.Column(db.Boolean, default =

Re: [sqlalchemy] Misleading warning for SqlAlchemy?

2014-09-11 Thread Victor Reichert
...@zzzcomputing.com javascript: wrote: you can filter the warnings as “ALWAYS” for now, and the warning here should probably not come out if you’ve in fact given remote_side so please raise an issue for that. On Sep 11, 2014, at 2:38 AM, Victor Reichert vfr...@gmail.com javascript: wrote: Hi, I'm

[sqlalchemy] How to tell if eager loading is working?

2014-08-06 Thread Victor Reichert
Hi, I'm trying my first eager load, and unfortunately it is a complex one. If the eager load is working, will an engine with the echo turned on still emit sql for the eager loaded objects? If so, how do I tell if the the object was actually eager loaded? The generated SQL looks correct, but

[sqlalchemy] Re: How to tell if eager loading is working?

2014-08-06 Thread Victor Reichert
Thank you for your response Jonathan! I'm new to sqlalchemy, what am I looking for with the log line? The time that passes between about to touch bars and touched bars or am I looking to see if SQL is generated? ~Victor -- You received this message because you are subscribed to the Google

[sqlalchemy] Re: How to tell if eager loading is working?

2014-08-06 Thread Victor Reichert
Thank you again! From the sql I'm getting (referenced as a pastie in my original post) t looks like the records are bing loaded that I intended to be eager loaded. D'oh! ~Victor -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe

[sqlalchemy] notin_ passed empty sequence with unexpected substitution

2013-08-06 Thread Victor Reichert
Hi, I'm running: selected_eventids = [] selected_event = self.session.query(Master_Simulation_Event).filter(Master_Simulation_Event.cumulative_probability = selection_percentile, Master_Simulation_Event.event_id.notin_(selected_eventids) ).\

Re: [sqlalchemy] Is definting a commit method good design?

2013-07-19 Thread Victor Reichert
it to my mind. :) 2013/7/18 Michael Bayer mik...@zzzcomputing.com javascript:: On Jul 18, 2013, at 6:52 PM, Victor Reichert vfr...@gmail.comjavascript: wrote: HI All, I'm working on my first SQL Alchemy project. I'm thinking I'm going to define a commit method for all

[sqlalchemy] Is definting a commit method good design?

2013-07-18 Thread Victor Reichert
HI All, I'm working on my first SQL Alchemy project. I'm thinking I'm going to define a commit method for all the objects I want persist, I'm thinking something like: def commit(self): session = Session() #Session is a global sessionmaker session.add(self)

[sqlalchemy] Multi Database Relationship With Primay Join (MSSQL)

2013-07-12 Thread Victor Reichert
Hello, I am attempting to implement a relationship accross two MSSQL databases that may or may not be on the samer server. The catch is that MSSQL does not support cross database forgien key contraints (the tables must be in the same db). I am trying to to implement the relationship with a

Re: [sqlalchemy] Connect to SQL Server (with pyodbc) getting error: sqlalchemy.exc.DBAPIError: (Error) ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default dri

2013-06-07 Thread Victor Reichert
as: [['dsn=mydsn;Trusted_Connection=Yes'], {}] looks good to me, so good luck ! On Jun 5, 2013, at 9:47 PM, Victor Reichert vfr...@gmail.comjavascript: wrote: Hello World! This is my first foray into python and SQL Alchemy, and I'm spinning my wheels. I'm running the code below

[sqlalchemy] Connect to SQL Server (with pyodbc) getting error: sqlalchemy.exc.DBAPIError: (Error) ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver

2013-06-05 Thread Victor Reichert
Hello World! This is my first foray into python and SQL Alchemy, and I'm spinning my wheels. I'm running the code below and am able to connect to my DB and query data without error. import pyodbc cnxn = pyodbc.connect('DSN=py_test; Trusted_Connection=Yes') However, when I try import