Did I find the right examples for you? yes no

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)
Returns a full path to the ISO 3166-1 alpha-2 country code flag image.

``flag_path`` is given in the form
``'<path relative to media root>/%s.gif'``
and is appended to ``settings.MEDIA_URL``

if a valid flag_path is not given trys to use
``settings.COUNTRIES_FLAG_PATH``
defaults to ``'flags/%s.gif'``

        def iso_flag(iso, flag_path=u''):
    """
    Returns a full path to the ISO 3166-1 alpha-2 country code flag image.

    ``flag_path`` is given in the form
    ``'/%s.gif'``
    and is appended to ``settings.MEDIA_URL``

    if a valid flag_path is not given trys to use
    ``settings.COUNTRIES_FLAG_PATH``
    defaults to ``'flags/%s.gif'``

    """
    default = u'-'
    if not iso:
        iso = default
    else:
        iso = iso.lower().strip()
    try:
        flag_name = flag_path % iso
    except (ValueError, TypeError):
        flag_path = getattr(settings, 'COUNTRIES_FLAG_PATH', u'flags/%s.png')
        try:
            flag_name = flag_path % iso
        except (ValueError, TypeError):
            return u''
    return flag_name
        


src/d/j/django-country-dialcode-0.5.1/country_dialcode/templatetags/country_dialcode_tags.py   django-country-dialcode(Download)
from django import template
from django.template.defaultfilters import stringfilter
from country_dialcode.models import Country
from country_dialcode.utils.isoflag import iso_flag as util_iso_flag
from django.utils.translation import gettext as _
    if country_id == '999':
        #Added for internal call - ie flag/phone.png
        return util_iso_flag('telephone', flag_path)
    try:
        obj_country = Country.objects.get(id=country_id)
    except:
        return u''
    return util_iso_flag(obj_country.iso2, flag_path)

src/d/j/django-country-dialcode-HEAD/country_dialcode/templatetags/country_dialcode_tags.py   django-country-dialcode(Download)
from django import template
from django.template.defaultfilters import stringfilter
from country_dialcode.models import Country
from country_dialcode.utils.isoflag import iso_flag as util_iso_flag
from django.utils.translation import gettext as _
    if country_id == '999':
        #Added for internal call - ie flag/phone.png
        return util_iso_flag('telephone', flag_path)
    try:
        obj_country = Country.objects.get(id=country_id)
    except:
        return u''
    return util_iso_flag(obj_country.iso2, flag_path)