@register.filter
def option_name(option_id):
    """Returns the option name for option with passed id.
    """
    try:
        option_id = int(float(option_id))
    except __HOLE__:
        pass

    try:
        option = PropertyOption.objects.get(pk=option_id)
    except (PropertyOption.DoesNotExist, ValueError):
        return option_id
    else:
        return option.name
dataset/ETHPy150Open diefenbach/django-lfs/lfs/core/templatetags/lfs_tags.py/option_name