Permalink
Browse files

iso_flag tag support internal call

  • Loading branch information...
1 parent 14152b6 commit 592396856d942feafe0814e71a910d3d563d768b @areski areski committed Nov 7, 2012
Showing with 12 additions and 4 deletions.
  1. +6 −0 CHANGES.txt
  2. +1 −1 country_dialcode/__init__.py
  3. +5 −3 country_dialcode/templatetags/country_dialcode_tags.py
View
@@ -2,6 +2,12 @@ Changelog
=========
+0.4.6 (2012-11-07)
+------------------
+
+* iso_flag tag support internal call
+
+
0.4.5 (2012-11-05)
------------------
@@ -9,7 +9,7 @@
# :license: MIT, see MIT-LICENSE.txt for more details.
-VERSION = (0, 4, 5, "")
+VERSION = (0, 4, 6, "")
__version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:])
__author__ = "Arezqui Belaid"
__contact__ = "areski@gmail.com"
@@ -1,7 +1,7 @@
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
register = template.Library()
@@ -17,12 +17,14 @@ def iso_flag(country_id, flag_path=u''):
{{ user_profile.country_dialcode.country_id|iso_flag:"appmedia/flags/%s.png" }}
"""
+ 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''
- from country_dialcode.utils.isoflag import iso_flag
- return iso_flag(obj_country.iso2, flag_path)
+ return util_iso_flag(obj_country.iso2, flag_path)
register.filter('iso_flag', iso_flag)

0 comments on commit 5923968

Please sign in to comment.