I have a fairly complex hybrid_property. This is a vendor model, which has multiple skuchannels (products). What it does is: Based on the target_stock_duration (e.g. we want to keep items in stock for 4 months) calculate how many units have to be ordered and how much this would cost. This gives us the potential. well this hybrid_property works just fine,
Tag: flask-admin
SQLAlchemy SQL expression with JSONB query
I have the following property on a flask-sqlalchemy model. I want to make this approved_at property a sortable column in flask-admin, but apparently I need to convert this to a hybrid property using SQL expressions. I don’t know how to convert this query into a sqlalchemy SQL expression, since it’s pretty complex with the JSONB query in it. I’ve looked
Flask-Admin inline-editable list dropdown menu squished (can’t see menu items)
A picture is worth a thousand words. Here’s what I’m trying to fix in Flask-Admin: I’m trying to edit a field from the list view by including the field in the column_editable_list of the model view. The field’s values come from another table via a foreign key relationship, so the user selects a value from the dropdown menu, which is
flask-admin form: Constrain Value of Field 2 depending on Value of Field 1
One feature I have been struggling to implement in flask-admin is when the user edits a form, to constrain the value of Field 2 once Field 1 has been set. Let me give a simplified example in words (the actual use case is more convoluted). Then I will show a full gist that implements that example, minus the “constrain” feature.