from django.core.management.base import BaseCommand, CommandError

from ...utils import get_variant

class Command(BaseCommand):
    USAGE = "<app_label> <model> <field> <variant>"

    def handle(self, *args, **options):
        try:
            app_label, model_name, field_name, variant_name = args
        except ValueError:
            raise CommandError(self.USAGE)

        variant = get_variant(app_label, model_name, field_name, variant_name)

        variant.invalidate_all()

Add command to invalidate all of a particular variant.
Add command to invalidate all of a particular variant.

Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@thread.com>
