#54 Grouped autocomplete

* refactors default autocomplete into grouped autocompletes, if parents exist for grouping
* updates requirement for django-autocomplete-light due to an issue with an attribute in pip's default version 3.8.2. More info here: https://github.com/yourlabs/django-autocomplete-light/issues/1278
This commit is contained in:
2022-01-07 13:50:37 +01:00
parent ea4dc636c8
commit 6ae10dd872
3 changed files with 75 additions and 7 deletions

View File

@@ -48,9 +48,9 @@ class KonovaCode(models.Model):
help_text="Whether this code is archived or not"
)
def __str__(self):
def __str__(self, with_parent: bool = True):
ret_val = ""
if self.parent:
if self.parent and with_parent:
ret_val += self.parent.long_name + " > "
ret_val += self.long_name
if self.short_name and self.short_name != self.long_name: