1👍
✅
You shouldn’t ever set a field directly to a queryset, and instead you should use a constructor.
Doing it directly will mean this is only ever done when the class is first referenced which may result in outdated information.
Simply just provide a constructor so this field is only initialized when you create an instance of the class
class CharterModalEmailOption(MessagesMixin, CharterMixin, TemplateView):
def __init__(self, *args, **kwargs):
self.footer_template = Mailtemplate.objects.get(slug='signatur')
Source:stackexchange.com