You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I using "group_by" sphinx functionality and want to have access to @count virtual sphinx attribute in django templates but I can't because django don't like "@" symbol in the beginning of the variable name. I mean I can't write in templates like this:
{% for item in results %}
Count of items in group: {{ item.sphinx.@count }}
{% endfor %}
I suggest to add a small patch to SphinxProxy class in models.py:
I using "group_by" sphinx functionality and want to have access to @count virtual sphinx attribute in django templates but I can't because django don't like "@" symbol in the beginning of the variable name. I mean I can't write in templates like this:
{% for item in results %}
Count of items in group: {{ item.sphinx.@count }}
{% endfor %}
I suggest to add a small patch to SphinxProxy class in models.py:
def count(self):
return self._sphinx['attrs'].get('@count')
I'm not sure that this is appropriate patch. What do you think?
The text was updated successfully, but these errors were encountered: