def handle(self, *args, **options):
        if len(args) < 2:
            print "Usage: opps_update_site_domain %s" % self.args
            return

        pk, domain = args[:2]
        s = Site.objects.get(pk=pk)
        s.domain = domain
        s.save(update_fields=['domain'])
        print "Site updated."
        print Channel.objects.filter(site_id=pk).update(site_domain=domain),
        print "Channels updated."
        print Container.objects.filter(site_id=pk).update(site_domain=domain),
        print "Containers updated."
dataset/ETHPy150Open opps/opps/opps/core/management/commands/opps_update_site_domain.py/Command.handle/original