def __init__(self, *args, **kwargs):
        super(MetricCategoryForm, self).__init__(*args, **kwargs)
        self.r = R()  # Keep a connection to our Redis wrapper
        # The list of available choices should include all metrics
        choices = [(slug, slug) for slug in self.r.metric_slugs()]
        self.fields['metrics'].choices = choices

        # If a "category" is provided, set inital values (pre-selected)
        initial = kwargs.get('initial', None)
        if initial and 'category_name' in initial:
            category = initial['category_name']
            self.fields['category_name'].initial = category
            self.fields['metrics'].initial = self.r._category_slugs(category)
See if this form is created with an initial Category. If so, we call
dataset/ETHPy150Open bradmontgomery/django-redis-metrics/redis_metrics/forms.py/MetricCategoryForm.__init__