You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use MPTT with parler to translate my website, more exactly the FAQ on it. The models are quite simples, but I didn't manage to succeed to configure it without django-categories-i18n. Google is failing me, Django copilot also... So I'm opening this issue, sorry about that.
I can create CategoryI18n, no problem here. The problem is when I try to create a question, even without a category (I added the blank=True to see if a question without category would work... The answer is no :( )
TypeError Traceback (most recent call last)
Cell In[4], line 1
----> 1 q.save()
File ~/git/knightools/venv/lib/python3.10/site-packages/parler/models.py:717, in TranslatableModelMixin.save(self, *args, **kwargs)
712 # Makes no sense to add these for translated model
713 # Even worse: mptt 0.7 injects this parameter when it avoids updating the lft/rgt fields,
714 # but that misses all the translated fields.
715 kwargs.pop("update_fields", None)
--> 717 self.save_translations(*args, **kwargs)
File ~/git/knightools/venv/lib/python3.10/site-packages/parler/models.py:759, in TranslatableModelMixin.save_translations(self, *args, **kwargs)
756 # Copy cache, new objects (e.g. fallbacks) might be fetched if users override save_translation()
757 # Not looping over the cache, but using _parler_meta so the translations are processed in the order of inheritance.
758 local_caches = self._translations_cache.copy()
--> 759 for meta in self._parler_meta:
760 local_cache = local_caches[meta.model]
761 translations = list(local_cache.values())
TypeError: 'NoneType' object is not iterable
It occurs too deeply for my knowledge and thus I have no idea about how to workaround this problem.
Any clue? I'm beginning to think I will have to duplicate all my databases and have multiple instances of my project running, one by language... But I would really prefer to make MPTT works (and also rest and elasticsearch, but that I will try once I succeed with MPTT)
The text was updated successfully, but these errors were encountered:
Hi.
I'm trying to use MPTT with parler to translate my website, more exactly the FAQ on it. The models are quite simples, but I didn't manage to succeed to configure it without django-categories-i18n. Google is failing me, Django copilot also... So I'm opening this issue, sorry about that.
Here are my models:
I can create CategoryI18n, no problem here. The problem is when I try to create a question, even without a category (I added the blank=True to see if a question without category would work... The answer is no :( )
In a shell:
It output this exception:
It occurs too deeply for my knowledge and thus I have no idea about how to workaround this problem.
Any clue? I'm beginning to think I will have to duplicate all my databases and have multiple instances of my project running, one by language... But I would really prefer to make MPTT works (and also rest and elasticsearch, but that I will try once I succeed with MPTT)
The text was updated successfully, but these errors were encountered: