Пример #1
0
 def _set_my_languages(self, *args):
     from auth.models import UserLanguage
     for ul in self.user.userlanguage_set.all():
         ul.delete()
     for lang in args:
         ul = UserLanguage(user=self.user, language=lang)
         ul.save()
     self.user = User.objects.get(id=self.user.id)
Пример #2
0
    def _set_my_languages(self, *args):
        from auth.models import UserLanguage

        for ul in self.user.userlanguage_set.all():
            ul.delete()
        for lang in args:
            ul = UserLanguage(user=self.user, language=lang)
            ul.save()
        self.user = User.objects.get(id=self.user.id)