mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-01-07 03:31:20 +01:00
add sqlite db
This commit is contained in:
14
pilot/database/models/components/sqlite_middlewares.py
Normal file
14
pilot/database/models/components/sqlite_middlewares.py
Normal file
@@ -0,0 +1,14 @@
|
||||
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
|
||||
Reference in New Issue
Block a user