updating readme
This commit is contained in:
parent
56e8e96963
commit
2d06d6175c
@ -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=...), ...]`
|
||||||
|
Loading…
Reference in New Issue
Block a user