Reputation: 675
I'm stuck a little bit with choosing django packages, that'll simplify the developing process for me: currently I'm using django-model-utils in order to get inheritance managers and stuff.
Now I'm thinking about geting some other package to help with translating model fields into several languages (>=2), and django-hvad seems like a right choice. Well, redefining models fields and schememigration I can get with south package, but what about the requirements from hvad docs, saying I have to use their manager (which contradicts with my desire of using django-model-utils inheritance manager).
Allow me to show some of my code, in order to understand what I have at the moment:
from django.conf import settings
from model_utils.managers import InheritanceManager
class UserProfile(AbstractUserProfile):
objects = InheritanceManager()
on_site = OnSiteInheritanceManager()
class OnSiteInheritanceManager(InheritanceManager):
def get_query_set(self):
return super(OnSiteInheritanceManager, self).get_query_set().filter(
sites=settings.SITE_ID).select_related().select_subclasses()
And, as you might expect, I have several types of user profiles, descending from UserPforile Class
How will I need to modify my managers policy in order to get inheritance from hvad.manager.TranslationManager
? Any other advices in order to help me solve multi-language model fields propblem?
Thanks in advance =)
Upvotes: 2
Views: 152