How to use the djangoql.schema.DateField function in djangoql

To help you get started, we’ve selected a few djangoql 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 ivelum / djangoql / djangoql / schema.py View on Github external
def get_field_cls(self, field):
        str_fields = (models.CharField, models.TextField, models.UUIDField)
        if isinstance(field, str_fields):
            return StrField
        elif isinstance(field, (models.AutoField, models.IntegerField)):
            return IntField
        elif isinstance(field, (models.BooleanField, models.NullBooleanField)):
            return BoolField
        elif isinstance(field, (models.DecimalField, models.FloatField)):
            return FloatField
        elif isinstance(field, models.DateTimeField):
            return DateTimeField
        elif isinstance(field, models.DateField):
            return DateField
        return DjangoQLField
github ivelum / djangoql / djangoql / schema.py View on Github external
def validate(self, value):
        super(DateField, self).validate(value)
        try:
            self.get_lookup_value(value)
        except ValueError:
            raise DjangoQLSchemaError(
                'Field "%s" can be compared to dates in '
                '"YYYY-MM-DD" format, but not to %s' % (
                    self.name,
                    repr(value),
                )