[sqlalchemy] is it possible to implement this anti-pattern in SQLAlchemy?

2020-05-16 Thread Jonathan Vanasco
Ok never mind! I realized I could scrap this entire functionality and replace it with something else. The use-case was trying to detect the backup renewal options for SSL Certificates if the private key Or account key is revoked. (foo is an ACME order if available, bar is the certificate).

Re: [sqlalchemy] Passing reference to model to model column_property function

2020-05-16 Thread Jonathan Vanasco
It’s been a while since I’ve worked on stuff like this, but IIRC the simplest way was to use a function that accepts an ID and to flush in SqlAlchemy before executing it. Then you select the necessary row fields within the sql function, instead of passing args in or trying to pass a row in.

Re: [sqlalchemy] Passing reference to model to model column_property function

2020-05-16 Thread Mike Bayer
On Sat, May 16, 2020, at 1:04 PM, Erol Merdanović wrote: > Hi > > I have a model definition > > class Product(db.Model): > __tablename__ = "products" > > id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4) > sku = db.Column(db.String(255), nullable=False, unique=True,

[sqlalchemy] Passing reference to model to model column_property function

2020-05-16 Thread Erol Merdanović
Hi I have a model definition class Product(db.Model): __tablename__ = "products" id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4) sku = db.Column(db.String(255), nullable=False, unique=True, index=True) Product.base_price = column_property(