mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-09 08:36:23 +01:00
Add more detail to docs
This commit is contained in:
@@ -121,6 +121,24 @@ Given the `EveCharacter` Model as our model of choice we would define our stubs
|
|||||||
|
|
||||||
Then we can setup out view in our `appname/views.py` file.
|
Then we can setup out view in our `appname/views.py` file.
|
||||||
|
|
||||||
|
### Columns definition
|
||||||
|
|
||||||
|
The `columns` must be defined as a 2 part tuple
|
||||||
|
|
||||||
|
- Part 1 is the database field that will be used for filtering and ordering. If this is a foreign key you need to point to a field that is compatible with `__icontains` like `charField` or `textField`. It can be `None`/`False`/`""` if no ordering for filtering is required for this row.
|
||||||
|
- Examples for the EveCharacter Model:
|
||||||
|
- `character_name`
|
||||||
|
- `character_ownership__user__username`
|
||||||
|
- `character_ownership__user__profile__main_character__character_name`
|
||||||
|
- Part 2 is a string that is used to the render the column for each row. This can be a html stub or a string containing django style template language.
|
||||||
|
- Examples for the EveCharacter Model
|
||||||
|
- `{{ row.character_name }}`
|
||||||
|
- `{{ row.character_ownership.user.username }}`
|
||||||
|
- `{{ row.character_ownership.user.profile.main_character.character_name }}`
|
||||||
|
- `appname/stubs/character_img.html`
|
||||||
|
|
||||||
|
### appname/views.py
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
# Alliance Auth
|
# Alliance Auth
|
||||||
|
|||||||
Reference in New Issue
Block a user