def get_docrule_by_id(self, id_):
        docrules = self.docrules
        docrule_instance = docrules.get(pk=id_)
        return docrule_instance
Works without making additional requests to DB.
dataset/ETHPy150Open adlibre/Adlibre-DMS/adlibre_dms/apps/core/models.py/DocumentTypeRuleManager.get_docrule_by_id