Skip to content

Commit e0729b7

Browse files
committed
Include already existing JSON operators in other dialects that were already supporting JSON/JSONB columns
1 parent a69eda6 commit e0729b7

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

pydal/dialects/postgre.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -379,14 +379,8 @@ def eq(self, first, second=None, query_env={}):
379379
return super(PostgreDialectArrays, self).eq(first, second, query_env)
380380

381381

382-
class PostgreDialectArraysJSON(PostgreDialectArrays):
383-
@sqltype_for("json")
384-
def type_json(self):
385-
return "JSON"
386-
387-
@sqltype_for("jsonb")
388-
def type_jsonb(self):
389-
return "JSONB"
382+
class PostgreDialectArraysJSON(PostgreDialectArrays, PostgreDialectJSON):
383+
pass
390384

391385

392386
@dialects.register_for(PostgreBoolean)
@@ -396,11 +390,5 @@ def type_boolean(self):
396390
return "BOOLEAN"
397391

398392

399-
class PostgreDialectBooleanJSON(PostgreDialectBoolean):
400-
@sqltype_for("json")
401-
def type_json(self):
402-
return "JSON"
403-
404-
@sqltype_for("jsonb")
405-
def type_jsonb(self):
406-
return "JSONB"
393+
class PostgreDialectBooleanJSON(PostgreDialectBoolean, PostgreDialectJSON):
394+
pass

0 commit comments

Comments
 (0)