Skip to content

Commit 85c4c1f

Browse files
authored
Merge pull request #41 from cloudblue/docs/LITE-21783
LITE-21783 Described support of JSON fields in README
2 parents a28ba97 + 9e71d35 commit 85c4c1f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,17 @@ Django Rest Framework Extensions
242242
Best Practices
243243
==============
244244
1. Use `dj_rql.utils.assert_filter_cls` to test your API view filters. If the mappings are correct and there is no custom filtering logic, then it's practically guaranteed, that filtering will work correctly.
245-
0. Prefer using `custom=True` with `RQLFilterClass.build_q_for_custom_filter` overriding over overriding `RQLFilterClass.build_q_for_filter`.
246-
0. Custom filters may support ordering (`ordering=True`) with `build_name_for_custom_ordering`.
245+
2. Prefer using `custom=True` with `RQLFilterClass.build_q_for_custom_filter` overriding over overriding `RQLFilterClass.build_q_for_filter`.
246+
3. Custom filters may support ordering (`ordering=True`) with `build_name_for_custom_ordering`.
247+
4. Django JSON fields can't be used as namespaces currently, but can be supported via `dynamic=True`, for example:
248+
```python
249+
{
250+
'filter': 'json_data.key',
251+
'source': 'json_data__key',
252+
'dynamic': True,
253+
'field': CharField(null=True),
254+
},
255+
```
247256

248257
Development
249258
===========

0 commit comments

Comments
 (0)