Skip to content

count of records in group #16

Open
@avostryakov

Description

@avostryakov

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions