title: How to have partially pre-rendered fields using Django-haystack
body: <p>I've started using a rendered field in my django-haystack indexing to avoid database hits when a search is rendered.  This is working well for the most part, but I have some runtime information (such as an edit button for staff) in the results as well that I'd like to splice in. A simplified example:</p>
  
  <pre><code>{{object.name}}&lt;br/&gt;
  {% if user.is_staff %}
      &lt;a href="{% url object_edit pk=object.id %}"&gt;Edit&lt;/a&gt;
  {% endif %}
  {{ object.description}}
  </code></pre>
  
  <p>The user logic obviously can't be applied at indexing time so doesn't occur. Without using javascript hacks is there a way to splice some runtime output in amongst the pre-rendered text?  I'm thinking it can be done by passing the rendered text with some formatting placeholders to a custom template tag, but I wonder if there's another way.</p>
  
  <p><strong>Edit:</strong> Perhaps multiple rendered, stored fields might be possible, covering the main fragments of the search result surrounding the logic parts, and then assembled at run time in the main results template. Would this work?</p>