cloudblue / django-rql

Django RQL library
Apache License 2.0
92 stars 13 forks source link

Using empty() on dynamic fields raises RQLFilterValueError: RQL Value error. #46

Closed ZipBrandon closed 2 years ago

ZipBrandon commented 2 years ago

When a filter is specified like the example, then json_data.key=empty() raises RQLFilterValueError. =null() works accordingly.

{
    'filter': 'json_data.key',
    'source': 'json_data__key',
    'dynamic': True,
    'field': CharField(null=True),
},
ZipBrandon commented 2 years ago

I fixed this error. The CharField should be CharField(null=True, blank=True). It would be helpful to have raise more helpful messages. https://github.com/cloudblue/django-rql/blob/00f5703ae4372f0a2c3bd4a89eff5ab7a9877780/dj_rql/filter_cls.py#L950

maxipavlovic commented 2 years ago

@ZipBrandon thx for feedback, we will consider!