How to use the pydal.parsers.for_type function in pydal

To help you get started, we’ve selected a few pydal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github web2py / pydal / pydal / parsers / oracle.py View on Github external
    @for_type("date")
    def _date(self, value):
        if isinstance(value, datetime):
            return value.date()
        (y, m, d) = map(int, str(value)[:10].strip().split("-"))
        return date(y, m, d)
github web2py / pydal / pydal / parsers / google.py View on Github external
    @for_type('boolean')
    def _boolean(self, value):
        return value
github web2py / pydal / pydal / parsers / base.py View on Github external
    @for_type("reference")
    def _reference(self, value, referee):
        if "." not in referee:
            value = Reference(value)
            value._table, value._record = self.adapter.db[referee], None
        return value
github web2py / pydal / pydal / parsers / sqlite.py View on Github external
    @for_type('date')
    def _date(self, value):
        if not isinstance(value, date):
            return DateParser._declared_parsers_['_date'].f(self, value)
        return value
github web2py / pydal / pydal / parsers / oracle.py View on Github external
    @for_type("integer")
    def _integer(self, value):
        return int(value)
github web2py / pydal / pydal / parsers / sqlite.py View on Github external
    @for_type('datetime')
    def _datetime(self, value):
        if not isinstance(value, datetime):
            return DateTimeParser._declared_parsers_['_datetime'].f(
                self, value)
        return value
github web2py / pydal / pydal / parsers / base.py View on Github external
    @for_type("integer")
    def _integer(self, value):
        return long(value)
github web2py / pydal / pydal / parsers / base.py View on Github external
    @for_type("list:integer")
    def _list_integers(self, value):
        return bar_decode_integer(value)
github web2py / pydal / pydal / parsers / postgre.py View on Github external
    @for_type('jsonb')
    def _jsonb(self, value):
        return self.json(value)
github web2py / pydal / pydal / parsers / base.py View on Github external
    @for_type("decimal")
    def _decimal(self, value):
        return Decimal(value)

pydal

pyDAL is a Database Abstraction Layer. It generates queries for SQlite, PotsgreSQL, MySQL, and other backends. It was originally part of the web2py frameworks but it is now an independent project. Example: db.define_table("thing",Field("name")) and db.thing.insert(name="Pizza")

BSD-3-Clause
Latest version published 11 days ago

Package Health Score

81 / 100
Full package analysis