code: def key_values(cls, *key_fields, **kwargs):
          
          flat = kwargs.pop('flat', False)
          assert not kwargs, "'flat' is the only kwarg accepted"
          key_fields = key_fields or cls.KEY_FIELDS
          cache_key = cls.key_values_cache_key_name(*key_fields)
          cached = cache.get(cache_key)
          if cached is not None:
              return cached
          values = list(cls.objects.values_list(*key_fields, flat=flat).order_by().distinct())
          cache.set(cache_key, values, cls.cache_timeout)
          return values
docs: Get the set of unique values in the configuration table for the given
          key[s]. Calling cls.current(*value) for each value in the resulting
          list should always produce an entry, though any such entry may have
          enabled=False.
  
          Arguments:
              key_fields: The positional arguments are the KEY_FIELDS to return. For example if
                  you had a course embargo configuration where each entry was keyed on (country,
                  course), then you might want to know "What countries have embargoes configured?"
                  with cls.key_values('country'), or "Which courses have country restrictions?"
                  with cls.key_values('course'). You can also leave this unspecified for the
                  default, which returns the distinct combinations of all keys.
              flat: If you pass flat=True as a kwarg, it has the same effect as in Django's
                  'values_list' method: Instead of returning a list of lists, you'll get one list
                  of values. This makes sense to use whenever there is only one key being queried.
  
          Return value:
              List of lists of each combination of keys found in the database.
              e.g. [("Italy", "course-v1:SomeX+some+2015"), ...] for the course embargo example