"""
Author: Michel Peltriaux
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
Contact: ksp-servicestelle@sgdnord.rlp.de
Created on: 18.08.22

"""
from codelist.autocomplete.base import KonovaCodeAutocomplete
from codelist.settings import CODELIST_PROCESS_TYPE_ID


class ProcessTypeCodeAutocomplete(KonovaCodeAutocomplete):
    """
    Due to limitations of the django dal package, we need to subclass for each code list
    """
    group_by_related = "parent"
    related_field_name = "long_name"

    def __init__(self, *args, **kwargs):
        self.c = CODELIST_PROCESS_TYPE_ID
        super().__init__(*args, **kwargs)
