[sqlalchemy] Re: Polymorphic self referential foreign key in sqlalchemy

2015-07-23 Thread Douglas Russell
Perfect, thanks! On Monday, 20 July 2015 10:49:26 UTC-4, Douglas Russell wrote: Apologies for cross-posting this, but I realised that this might be a better place to get an answer than this Stackoverflow question

Re: [sqlalchemy] marking an object read-only / recursive expunge?

2015-07-23 Thread Jonathan Vanasco
So my code above is just completely wrong. This code actually does what one expects: def recursive_expunge(obj, dbSession): def _recursive_expunge(_obj): _instance_state = sqlalchemy.inspection.inspect(_obj) _mapper = _instance_state.mapper try:

Re: [sqlalchemy] question about `sqlalchemy.orm.mapper.Mapper` and objects

2015-07-23 Thread Jonathan Vanasco
Yeah, no error. I'll guess that: * My code isn't doing what I intended * but *SqlAlchemy isn't raising an error So I can work with that. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails

Re: [sqlalchemy] Disabling implicit lazy loading

2015-07-23 Thread Mike Bayer
On 7/23/15 10:09 AM, Mike Bayer wrote: On 7/23/15 1:24 AM, Yegor Roganov wrote: Hi all! Is there a way to disable implicit loading of relationships? For example, I want an exception to be thrown if I try to access 'address.user' unless user was explicitly loaded via options address =

Re: [sqlalchemy] Disabling implicit lazy loading

2015-07-23 Thread Mike Bayer
On 7/23/15 1:24 AM, Yegor Roganov wrote: Hi all! Is there a way to disable implicit loading of relationships? For example, I want an exception to be thrown if I try to access 'address.user' unless user was explicitly loaded via options address =

[sqlalchemy] natural vs surrogate keys for user groups?

2015-07-23 Thread Iain Duncan
Hi folks, I'm starting a green field project and one component is a stand alone auth micro service. It will have one job only, log people in and set their group list. After that, the group list and user id will be going in jwt tokens and will be used in subsequent apps as fields for the remote

[sqlalchemy] best books on DB design for sqlalchemy users?

2015-07-23 Thread Iain Duncan
I feel like I should really take up my db game for an upcoming set of projects, and am wondering if there are any real standout books on db design that fit well with the design philosophy of SQLA. Recos much appreciated! thanks Iain -- You received this message because you are subscribed to the

Re: [sqlalchemy] Many-to-Many Table

2015-07-23 Thread Mike Bayer
On 7/23/15 2:18 PM, Rich Shepard wrote: Originally posted here on June 4th, but no one responded. I'm now back on this project and this should be the last table I need to add to the schema. I would appreciate your review of the below class and whether it is good to go or needs your

Re: [sqlalchemy] Many-to-Many Table

2015-07-23 Thread Rich Shepard
On Thu, 23 Jul 2015, Mike Bayer wrote: conceptually not a big deal but API-wise has many mistakes. Sequences don't work with unicode, there is no value parameter, the table has no primary key. Mike, True, I don't want a sequence but the location ID, there needs to be a value column, and

Re: [sqlalchemy] question about `sqlalchemy.orm.mapper.Mapper` and objects

2015-07-23 Thread Mike Bayer
On 7/23/15 3:04 PM, Jonathan Vanasco wrote: so does dbSession.expunge(relationship) when `relationship` is an item from `sqlalchemy.inspection.inspect(obj).mapper.relationships.values()` somehow expunge the object-specific relationship, or all relationships ? that should raise an

[sqlalchemy] question about `sqlalchemy.orm.mapper.Mapper` and objects

2015-07-23 Thread Jonathan Vanasco
This is an extension of my question about recursive object expunging (https://groups.google.com/forum/#!topic/sqlalchemy/lUhCDfkPc9k) Is the mapper that is accessed via `sqlalchemy.inspection.inspect(obj).mapper` and stored in `object.__mapper__` specific to the instance? I thought it was the

Re: [sqlalchemy] question about `sqlalchemy.orm.mapper.Mapper` and objects

2015-07-23 Thread Mike Bayer
On 7/23/15 2:28 PM, Jonathan Vanasco wrote: This is an extension of my question about recursive object expunging (https://groups.google.com/forum/#!topic/sqlalchemy/lUhCDfkPc9k) Is the mapper that is accessed via `sqlalchemy.inspection.inspect(obj).mapper` and stored in `object.__mapper__`

[sqlalchemy] Many-to-Many Table

2015-07-23 Thread Rich Shepard
Originally posted here on June 4th, but no one responded. I'm now back on this project and this should be the last table I need to add to the schema. I would appreciate your review of the below class and whether it is good to go or needs your modifications. Section 2.1.15 in the 1.0.8 manual

Re: [sqlalchemy] best books on DB design for sqlalchemy users?

2015-07-23 Thread Rich Shepard
On Thu, 23 Jul 2015, Iain Duncan wrote: I feel like I should really take up my db game for an upcoming set of projects, and am wondering if there are any real standout books on db design that fit well with the design philosophy of SQLA. Recos much appreciated! Iain, Read Joe Celko's books,

Re: [sqlalchemy] best books on DB design for sqlalchemy users?

2015-07-23 Thread Richard Gerd Kuesters
not quite sqlalchemy related, but one of the best readings i've had about sql was SQL Anti-Patterns: https://pragprog.com/book/bksqla/sql-antipatterns it is not about how to do sql right, it's about not to do certain types of sql, lol. On 07/23/2015 01:35 PM, Rich Shepard wrote: On Thu,