def create_metric(name, slug):

    # This should be a NOOP for the non-database-backed backends
    if not should_create_models():
        return

    # See if this metric already exists
    existing = Metric.objects.filter(name=name, slug=slug)

    if existing:
        return False
    else:
        new_metric = Metric(name=name, slug=slug)
        new_metric.save()
        return new_metric
Creates a new switch button.
dataset/ETHPy150Open frankwiles/django-app-metrics/app_metrics/utils.py/create_metric--crossover with--dataset/ETHPy150Open rwl/muntjac/muntjac/ui/check_box.py/CheckBox.__init__