New method for update tables using directly old tables in mariadb
This commit is contained in:
parent
dec0613c75
commit
2599eabed0
9 changed files with 151 additions and 22 deletions
|
|
@ -38,6 +38,8 @@ class ArrayField(PhangoField):
|
|||
self.error_default='Sorry, the json array is invalid'
|
||||
|
||||
self.set_default='NOT NULL'
|
||||
|
||||
self.type_sql='text'
|
||||
|
||||
def check(self, value):
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ class DateTimeField(PhangoField):
|
|||
self.utc=False
|
||||
|
||||
self.error_default='Error: Date format invalid'
|
||||
|
||||
self.type_sql='datetime'
|
||||
|
||||
def check(self, value):
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ class DictField(PhangoField):
|
|||
self.error_default='Sorry, the json dict is invalid'
|
||||
|
||||
self.set_default='NOT NULL'
|
||||
|
||||
self.type_sql='longtext'
|
||||
|
||||
def check(self, value):
|
||||
|
||||
|
|
@ -73,7 +75,7 @@ class DictField(PhangoField):
|
|||
|
||||
def get_type_sql(self):
|
||||
|
||||
return 'TEXT '+self.set_default
|
||||
return 'JSON '+self.set_default
|
||||
|
||||
def show_formatted(self, value):
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@ class I18nField(PhangoField):
|
|||
|
||||
arr_i18n={i:'' for i in I18n.dict_i18n}
|
||||
self.default_value=json.dumps(arr_i18n)
|
||||
|
||||
self.type_sql='longtext'
|
||||
|
||||
def change_form(self, form):
|
||||
self.extra_parameters=[form]
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ class JsonField(PhangoField):
|
|||
|
||||
self.set_default='NOT NULL'
|
||||
|
||||
self.type_sql='longtext'
|
||||
|
||||
def check(self, value):
|
||||
|
||||
if type(value).__name__=='str':
|
||||
|
|
@ -75,7 +77,7 @@ class JsonField(PhangoField):
|
|||
|
||||
def get_type_sql(self):
|
||||
|
||||
return 'LONGTEXT '+self.set_default
|
||||
return 'JSON '+self.set_default
|
||||
|
||||
def show_formatted(self, value):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue