Re: [sqlalchemy] style question: correct practice for creating relationship ?

2017-11-29 Thread Jonathan Vanasco
thanks, michael. i'll look into that! -- 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: [sqlalchemy] style question: correct practice for creating relationship ?

2017-11-29 Thread Mike Bayer
On Wed, Nov 29, 2017 at 3:32 PM, Jonathan Vanasco wrote: > I have a potential relationship between Foo and Bar that is defined as > follows, and has usually been read-only from legacy data. > > All the code works, I just want to make sure I'm handling this case in a > clear

[sqlalchemy] style question: correct practice for creating relationship ?

2017-11-29 Thread Jonathan Vanasco
I have a potential relationship between Foo and Bar that is defined as follows, and has usually been read-only from legacy data. All the code works, I just want to make sure I'm handling this case in a clear and concise way. I've (over)simplified the case down to this: class Foo(Base):

Re: [sqlalchemy] Dictionaries with mapped objects as keys and integers as values

2017-11-29 Thread Mike Bayer
On Wed, Nov 29, 2017 at 11:45 AM, Sven wrote: > Hello everybody, > > Is it possible to map dictionaries whose keys are objects and the values > simple integers? > > I have the following case : > > In the program, there is one instance of "Options" which contains a >

[sqlalchemy] Dictionaries with mapped objects as keys and integers as values

2017-11-29 Thread Sven
Hello everybody, Is it possible to map dictionaries whose keys are objects and the values simple integers? I have the following case : *In the program, there is one instance of "Options" which contains a dictionary. This dictionary has players as keys and integers as values. These integers

Re: [sqlalchemy] How about: Disabling relationship cascades on a per-object basis.

2017-11-29 Thread Mike Bayer
On Wed, Nov 29, 2017 at 11:14 AM, Michael Elsdörfer wrote: > So, I've been a very happy user of SQLAlchemy over many years, though maybe > not very deeply. I certainly don't really feel qualified to contribute any > thoughts on it's design, but I did want to bring this up,

[sqlalchemy] How about: Disabling relationship cascades on a per-object basis.

2017-11-29 Thread Michael Elsdörfer
So, I've been a very happy user of SQLAlchemy over many years, though maybe not very deeply. I certainly don't really feel qualified to contribute any thoughts on it's design, but I did want to bring this up, since it's something I have run into again and again. I'd say that in the majority of

Re: [sqlalchemy] Possible Exceptions

2017-11-29 Thread Mike Bayer
On Wed, Nov 29, 2017 at 3:37 AM, wrote: > Hello everybody, > > I am writing some piece of code, which should not exit unforseen in the best > case, at least it should write to a log file what went wrong (e.g. Database > not reachable, etc). So I tried figuring out, which

[sqlalchemy] Possible Exceptions

2017-11-29 Thread lars . liedtke
Hello everybody, I am writing some piece of code, which should not exit unforseen in the best case, at least it should write to a log file what went wrong (e.g. Database not reachable, etc). So I tried figuring out, which Exceptions would be possibly thrown by SQLAlchemy: - The first thing