Horje
Use a callable instead, e.g., use `dict` instead of `{}` Code Example
Use a callable instead, e.g., use `dict` instead of `{}`
# You have two options here:

# 1.Rely on dict as a default; this will result in your models using an empty dict {} if none is supplied:
class UnderwritingValidator(TimeStampedModel):
    plan = models.PositiveIntegerField(null=True, blank=True, unique=True)
    logic = JSONField(default=dict)

# 2.Create your own "callable" and use it as default:
def get_default_something():
    return {'accept_list': [], 'reject_list': []}

class UnderwritingValidator(TimeStampedModel):
    plan = models.PositiveIntegerField(null=True, blank=True, unique=True)
    logic = JSONField(default=get_default_something)




Python

Related
PHP echo multiple lines example Using Nowdoc Code Example PHP echo multiple lines example Using Nowdoc Code Example
selenium get back from iframe python Code Example selenium get back from iframe python Code Example
radians in python turtle Code Example radians in python turtle Code Example
printed in a comma-separated sequence on a single line. Code Example printed in a comma-separated sequence on a single line. Code Example
check if digit or alphabet Code Example check if digit or alphabet Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7