我在选择django包时遇到了一点困难,这将简化我的开发过程:目前我使用django模型utils来获得继承管理器之类的东西。你知道吗
现在我正在考虑使用其他软件包来帮助将模型字段翻译成多种语言(>;=2),django hvad似乎是一个正确的选择。好吧,我可以用south包重新定义模型字段和schememigration,但是hvad docs的需求呢,说我必须使用他们的管理器(这与我使用django model utils继承管理器的愿望相矛盾)。你知道吗
请允许我展示我的一些代码,以便了解我目前的情况:
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()
而且,正如您所料,我有几种类型的用户配置文件,从UserPforile Class
开始递减
为了从hvad.manager.TranslationManager
获得继承,我需要如何修改我的管理器策略?还有什么建议可以帮助我解决多语言模型域的问题吗?你知道吗
提前感谢=)
目前没有回答
相关问题 更多 >
编程相关推荐