Re: [sqlalchemy] Foreign key not set, fails for NOT NULL

2019-11-21 Thread Steven Riggs
Simon, you are a GENIUS! Thank you SO much! Flushing was the answer. I simply added this to my original: class Color(db.Model): ... def __init__(self, medium, name, *, pure=True, recipe=[]): ... self.pure = False if len(recipe) > 1 else True *db.session.add(se

Re: [sqlalchemy] Foreign key not set, fails for NOT NULL

2019-11-21 Thread Steven Riggs
Simon, I don't think I understood correctly what you meant. I changed this code: class Color(db.Model): ... def __init__(self, medium, name, *, pure=True, recipe=[]): self.medium = medium.upper() self.name = name self.pure = False if len(recipe) > 1 else True

Re: [sqlalchemy] Foreign key not set, fails for NOT NULL

2019-11-21 Thread Steven Riggs
Simon, I don't think I understood correctly what you meant. I changed this code: class Color(db.Model): ... def __init__(self, medium, name, *, pure=True, recipe=[]): self.medium = medium.upper() self.name = name self.pure = False if len(recipe) > 1 else True

Re: [sqlalchemy] Foreign key not set, fails for NOT NULL

2019-11-21 Thread Steven Riggs
Thank you very much Simon. I will try this and let you know. On Monday, November 18, 2019 at 3:02:23 AM UTC-7, Simon King wrote: > > On Mon, Nov 18, 2019 at 5:32 AM Steven Riggs > wrote: > > > > Hello, > > > > I have been all over the web, Stack Overflow and Youtube, and cannot > find any an

Re: [sqlalchemy] Accessing rowid when adding or merging in Oracle

2019-11-21 Thread Javier Collado Jiménez
Thank you, it worked perfectly! El miércoles, 20 de noviembre de 2019, 16:39:36 (UTC+1), Mike Bayer escribió: > > > > On Wed, Nov 20, 2019, at 9:05 AM, Javier Collado Jiménez wrote: > > Hello, > > Using ORM, i'm inserting like that: > > session.add(table_mapper(**datum)) > > And updating: > > ses