skip to Main Content

Aggregate (nested) JSON key value of JSONField Django PostgreSQL

I have a simple model setup as below, import random import string from django.db import models def random_default(): random_str = "".join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10)) return {"random": random_str, "total_price": random.randint(1, 100)} class Foo(models.Model): cart = models.JSONField(default=random_default) I want…

VIEW QUESTION

Javascript – regular expression

regex expression which contains 9 atleast alphabets and 1 digits and the position of alphabets and digit can be anywhere. eg- rahulkumar1 rahul9kumar 1RahulKumar /[A-Za-z]{9,}[0-9]{0,1}/ I have tried using this but it does not worked out.enter image description here

VIEW QUESTION
Back To Top
Search