updating readme

This commit is contained in:
Gabor Körber 2021-06-02 10:53:25 +02:00
parent 56e8e96963
commit 2d06d6175c

View File

@ -99,7 +99,11 @@ Building this record, which for now we assume will be a frozen dataclass in the
```python ```python
queryset = MyModel.objects.filter(...)\ queryset = MyModel.objects.filter(...)\
.records(MyRecord, 'data', age=Adjunct(0), parent_name=F('parent__name'), has_data=Lambda(lambda d: d.get('data') is not None)) .records(MyRecord, 'data',
age=Adjunct(0),
parent_name=F('parent__name'),
has_data=Lambda(lambda d: d.get('data') is not None),
)
``` ```
`list(queryset)` will return data like this: `[MyRecord(name=..., age=0, parent_id=..., parent_name=..., has_data=...), ...]` `list(queryset)` will return data like this: `[MyRecord(name=..., age=0, parent_id=..., parent_name=..., has_data=...), ...]`