title: How do I write a Django template custom tag that adds a slash before a single quote?
body: <p>Am I doing this right? (probably not...someone correct? thanks)</p>
  
  <pre><code>@register.filter('addslashes')
  @stringfilter
  def addslashes(text, arg):
      return text.replace('\'','\\'')
  
  
  {{ query|addslashes }}
  </code></pre>