def get(self, request, *args, **kwargs): spm = request.GET.get('spm', '') users_id = cache.get(KEY_CACHE_RESOURCES_ID.format(spm)) if kwargs.get('form'): self.form = kwargs['form'] elif users_id: self.form = self.form_class(initial={'users': users_id}) else: self.form = self.form_class() return super().get(request, *args, **kwargs)
def get(self, request, *args, **kwargs): spm = request.GET.get('spm', '') assets_id = cache.get(KEY_CACHE_RESOURCES_ID.format(spm)) if kwargs.get('form'): self.form = kwargs['form'] elif assets_id: self.form = self.form_class(initial={'assets': assets_id}) else: self.form = self.form_class() return super().get(request, *args, **kwargs)