main
Last change
on this file was
42bd667,
checked in by David Fuertes <dfuertes@…>, 4 years ago
|
Historial Limpio
|
-
Property mode set to
100755
|
File size:
815 bytes
|
Line | |
---|
1 | from ..adapters.postgres import Postgre, PostgreNew, PostgreBoolean |
---|
2 | from .base import BasicParser, ListsParser, JSONParser |
---|
3 | from . import parsers, for_type |
---|
4 | |
---|
5 | |
---|
6 | @parsers.register_for(Postgre) |
---|
7 | class PostgreParser(ListsParser, JSONParser): |
---|
8 | @for_type("jsonb") |
---|
9 | def _jsonb(self, value): |
---|
10 | return self.registered["json"](value, "json") |
---|
11 | |
---|
12 | |
---|
13 | class PostgreAutoJSONParser(ListsParser): |
---|
14 | pass |
---|
15 | |
---|
16 | |
---|
17 | @parsers.register_for(PostgreNew) |
---|
18 | class PostgreNewParser(JSONParser): |
---|
19 | pass |
---|
20 | |
---|
21 | |
---|
22 | class PostgreNewAutoJSONParser(BasicParser): |
---|
23 | pass |
---|
24 | |
---|
25 | |
---|
26 | @parsers.register_for(PostgreBoolean) |
---|
27 | class PostgreBooleanParser(JSONParser): |
---|
28 | @for_type("boolean") |
---|
29 | def _boolean(self, value): |
---|
30 | return value |
---|
31 | |
---|
32 | |
---|
33 | class PostgreBooleanAutoJSONParser(BasicParser): |
---|
34 | @for_type("boolean") |
---|
35 | def _boolean(self, value): |
---|
36 | return value |
---|
Note: See
TracBrowser
for help on using the repository browser.