コード例 #1
0
ファイル: user_settings.py プロジェクト: mercycorps/tola-help
def run():
    for u in User.objects.all():
        try:
            s = UserSettings.objects.get(user=u)
        except UserSettings.DoesNotExist:
            s = UserSettings(user=u, settings=DEFAULT_USER_SETTINGS)
            s.save()
コード例 #2
0
 def handle(self, *args, **options):
     "handle command line"
     for u in User.objects.all():
         try:
             s = UserSettings.objects.get(user=u)
         except UserSettings.DoesNotExist:
             s = UserSettings(user=u, settings=DEFAULT_USER_SETTINGS)
             s.save()
コード例 #3
0
 def handle(self, *args, **options):
     "handle command line"
     for u in User.objects.all():
         try:
             s = UserSettings.objects.get(user=u)
         except UserSettings.DoesNotExist:
             s = UserSettings(user=u, settings=DEFAULT_USER_SETTINGS)
             s.save()