# coding: utf-8
from __future__ import absolute_import, print_function, unicode_literals

from django.core.management import BaseCommand

from api.models import ServiceComment
from api.models import ServiceCommentImage


class Command(BaseCommand):
    def handle(self, *args, **kwargs):
        servicecomment_id_list = set(ServiceCommentImage.objects.all().values_list('service_comment_id', flat=True))
        ServiceComment.objects.filter(pk__in=servicecomment_id_list).update(with_images=True)
