1. Yes, literal_column does the trick.
2. I have tried with hybrid_method. It also works with literal_column, but
the problem here is that it's not including the field automatically in the
query? I suspect this is by design, but in my case it's required to execute
function so that I get a value
On Sun, May 17, 2020, at 6:54 AM, Erol Merdanović wrote:
> Hi
>
> First thank you for your reply.
>
> @Mike, yes. I wish to pass the row products row. I'm attaching working SQL
>
>> SELECT *, get_product_price(products) FROM products;
>
> This works great in postgres. I tried it also on Mysql
Hi
First thank you for your reply.
@Mike, yes. I wish to pass the row products row. I'm attaching working SQL
SELECT *, get_product_price(products) FROM products;
This works great in postgres. I tried it also on Mysql but they support
only scalar values. I suspect that might work with other d
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.
In
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, inde
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(
cast(func.get_product_price()