skip to Main Content

How to check if key is in JSON sqlachemy

I am trying to select a segment if: settings dict is not null Has key user_parameters in it And user_parameters (dict) has key user_id in it Code below: user_id = '100952' select([self.db.segments]).where( and_( self.db.segments.c.settings.isnot(None), cast(self.db.segments.c.settings, JSON)["user_parameters"].as_string().contains(f"'{user_id}'"), ) ) Converting JSON…

VIEW QUESTION

Html – I keep getting the same error when making an onclick function passing through jinja variables

I keep getting the error: Uncaught SyntaxError: missing ) after argument list (at bestellen:60:105) this is my html: <div class="gerechten"> {% for gerecht in gerechten %} <div class="Gerechtdiv"> <img src={{gerecht.url}} class="gerechtimg"> <h3 class="GerechtTitel">{{gerecht.gerecht}}</h3> <p class ="GerechtBeschrijving">{{gerecht.beschrijving}}</p> <div class ="BottomGerechtDiv"> <p…

VIEW QUESTION

Can Flask return a JSON array of objects?

I am working on a simple CRUD application and I can't return an array of objects in Flask. My db Model is like this: class QrRecord(db.Model): id = db.Column(db.String(256), primary_key=True) name = db.Column(db.String(128), nullable=False) date = db.Column(db.Date, nullable=False) qrType =…

VIEW QUESTION
Back To Top
Search