code: def _resolve(value, model_instance=None, context=None):
      
  
      if isinstance(value, basestring) and "{" in value:
          if context is None:
              context = Context()
          if model_instance is not None:
              context[model_instance._meta.module_name] = model_instance
          value = Template(value).render(context)
      return value
docs: Resolves any template references in the given value.