Fix default json value
This commit is contained in:
Binary file not shown.
@@ -3,13 +3,16 @@ from django.core.validators import MinValueValidator, MaxValueValidator
|
|||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
|
||||||
|
def default_json_value():
|
||||||
|
return {"details": "todo"}
|
||||||
|
|
||||||
class Task(models.Model):
|
class Task(models.Model):
|
||||||
title = models.CharField(max_length=255)
|
title = models.CharField(max_length=255)
|
||||||
description = models.TextField()
|
description = models.TextField()
|
||||||
price_from = models.IntegerField(validators=[MinValueValidator(0)])
|
price_from = models.IntegerField(validators=[MinValueValidator(0)])
|
||||||
price_to = models.IntegerField(validators=[MinValueValidator(0)])
|
price_to = models.IntegerField(validators=[MinValueValidator(0)])
|
||||||
|
|
||||||
needed_information = models.JSONField(default=dict)
|
needed_information = models.JSONField(default=default_json_value)
|
||||||
order = models.IntegerField(null=True)
|
order = models.IntegerField(null=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user