code: def format_date(format_string, localize=False, key=None):
      
  
      if localize is not False and localtime is None:
          raise Exception("Cannot use format_date argument 'localize' with Django < 1.5")
  
      def helper(value, *args, **kwargs):
          inner_localize = kwargs.get('localize', localize)
          if inner_localize is not False and localtime is None:
              raise Exception("Cannot use format_date argument 'localize' with Django < 1.5")
  
          if key:
              value = key(value)
          else:
              value = kwargs.get('default_value', value)
          if not value:  # Empty or missing default_value
              return ""
          if localize:
              value = localtime(value)
          return value.strftime(format_string)
  
      if key:
          return keyed_helper(helper)(key=key)
      return helper
docs: A pre-called helper to supply a date format string ahead of time, so that it can apply to each
      date or datetime that this column represents.  With Django >= 1.5, the ``localize=True`` keyword
      argument can be given, or else can be supplied in the column's own declaration for the same
      effect.  (The date and datetime columns explicitly forward their ``localize`` setting to all
      helpers.)
  
      If the ``key`` argument is given, it may be a function which maps the target value to something
      else before the date formatting takes place.