mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2025-12-27 22:57:50 +01:00
15 lines
314 B
Python
15 lines
314 B
Python
import json
|
|
from peewee import TextField
|
|
|
|
|
|
class JSONField(TextField):
|
|
def python_value(self, value):
|
|
if value is not None:
|
|
return json.loads(value)
|
|
return value
|
|
|
|
def db_value(self, value):
|
|
if value is not None:
|
|
return json.dumps(value)
|
|
return value
|