-from forum.models import User, SubscriptionSettings, QuestionSubscription\r
-from django.core.management.base import NoArgsCommand\r
-\r
-class Command(NoArgsCommand):\r
- def handle_noargs(self, **options):\r
- users = User.objects.all()\r
- for u in users:\r
- s = SubscriptionSettings(user=u)\r
- s.save()\r
-\r
- user_questions = u.questions.all()\r
-\r
- for q in user_questions:\r
- sub = QuestionSubscription(user=u, question=q)\r
+from forum.models import User, SubscriptionSettings, QuestionSubscription
+from django.core.management.base import NoArgsCommand
+
+class Command(NoArgsCommand):
+ def handle_noargs(self, **options):
+ users = User.objects.all()
+ for u in users:
+ s = SubscriptionSettings(user=u)
+ s.save()
+
+ user_questions = u.questions.all()
+
+ for q in user_questions:
+ sub = QuestionSubscription(user=u, question=q)
sub.save()
\ No newline at end of file