示例#1
0
    def handle(self, *args, **options):
        users = User.objects.filter(player__isnull=True, is_superuser=False)

        for user in users:
            player = Player.objects.create(user=user, name=user.first_name)
            update_player.delay(player.id)
示例#2
0
 def handle(self, *args, **options):
     for player in Player.objects.all():
         update_player.delay(player.id)
示例#3
0
 def handle(self, *args, **options):
     users = User.objects.filter(player__isnull=True, is_superuser=False)
     
     for user in users:
         player = Player.objects.create(user=user,name=user.first_name)
         update_player.delay(player.id)