feat(assistance): Categorised Knowledge base articles

!43 #10
This commit is contained in:
2024-07-21 00:35:26 +09:30
parent 2e7a6a42b4
commit 4b3ea06f70
29 changed files with 2248 additions and 29 deletions

View File

@ -27,6 +27,30 @@ All forms must meet the following requirements:
- Any filtering of a fields `queryset` is to filter the existing `queryset` not redefine it. i.e. `field[<field name>].queryset = field[<field name>].queryset.filter()`
- validating fields where the validation requires access to multiple fields is done inside the form class using function `clean`
``` py
def clean(self):
cleaned_data = super().clean()
# begin example
responsible_user = cleaned_data.get("responsible_user")
responsible_teams = cleaned_data.get("responsible_teams") example
if not responsible_user and not responsible_teams:
raise ValidationError('A Responsible User or Team must be assigned.')
# end example
# your validation after `super()` call
return cleaned_data
```
## Abstract Classes

View File

@ -33,6 +33,11 @@ All models must meet the following requirements:
- No `queryset` is to return data that the user has not got access to. _see [queryset()](./api/models/tenancy_object.md#tenancy-object-manager)_
- Single Field validation is conducted if required.
!!! danger "Requirement"
Multi-field validation, or validation that requires access to multiple fields must be done within the [form class](./forms.md#requirements).
## History