@classmethod
def generate_name(cls, counter_name, display_name=None, prefix=None, fill=3):
    """Generate a name based on a counter

        :param str counter_name: name of the counter in the database
        :param str display_name: pretty name to show user (defaults to ``counter_name``)
        :param str prefix: prefix the generated name with this
        :param int fill: number of zeros to fill with
        :returns: a generated name
        :rtype: :class:`str`
        """
    prefix = prefix + '-' if prefix else ''
    counter = cls.get_counter(name=counter_name)
    index = str(counter).zfill(fill)
    name = prefix + (display_name or counter_name) + '-' + index
    cls.incr_counter(name=counter_name)
    return name
