website/docs: improve docs for expressions

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-05-29 21:47:35 +02:00
parent 6232333a52
commit a4c28a28b4
10 changed files with 122 additions and 81 deletions

View File

@ -15,9 +15,16 @@ The User object has the following attributes:
- `group_attributes` Merged attributes of all groups the user is member of and the user's own attributes.
- `ak_groups` This is a queryset of all the user's groups.
You can do additional filtering like `user.ak_groups.filter(name__startswith='test')`, see [here](https://docs.djangoproject.com/en/3.1/ref/models/querysets/#id4)
You can do additional filtering like
```python
user.ak_groups.filter(name__startswith='test')
```
see [here](https://docs.djangoproject.com/en/3.1/ref/models/querysets/#id4)
To get the name of all groups, you can do `[group.name for group in user.ak_groups.all()]`
To get the name of all groups, you can do
```python
[group.name for group in user.ak_groups.all()]
```
## Examples