Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

count of records in group #16

Open
avostryakov opened this issue Oct 14, 2010 · 0 comments
Open

count of records in group #16

avostryakov opened this issue Oct 14, 2010 · 0 comments

Comments

@avostryakov
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant