source: OpenRLabs-Git/deploy/rlabs-docker/web2py-rlabs/gluon/packages/dal/pydal/parsers/postgre.py

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 
1from ..adapters.postgres import Postgre, PostgreNew, PostgreBoolean
2from .base import BasicParser, ListsParser, JSONParser
3from . import parsers, for_type
4
5
6@parsers.register_for(Postgre)
7class PostgreParser(ListsParser, JSONParser):
8    @for_type("jsonb")
9    def _jsonb(self, value):
10        return self.registered["json"](value, "json")
11
12
13class PostgreAutoJSONParser(ListsParser):
14    pass
15
16
17@parsers.register_for(PostgreNew)
18class PostgreNewParser(JSONParser):
19    pass
20
21
22class PostgreNewAutoJSONParser(BasicParser):
23    pass
24
25
26@parsers.register_for(PostgreBoolean)
27class PostgreBooleanParser(JSONParser):
28    @for_type("boolean")
29    def _boolean(self, value):
30        return value
31
32
33class PostgreBooleanAutoJSONParser(BasicParser):
34    @for_type("boolean")
35    def _boolean(self, value):
36        return value
Note: See TracBrowser for help on using the repository browser.