Closed himedlooff closed 10 years ago
When I do:
{% for tags in queries.posts.possible_values_for('tags') %}
{{ tags }}
{% endfor %}
I get:
{u'count': 67, u'term': u'Mortgages'}
{u'count': 62, u'term': u'Students'}
{u'count': 47, u'term': u'Student loans'}
{u'count': 38, u'term': u'Financial education'}
{u'count': 35, u'term': u'Rulemaking'}
{u'count': 31, u'term': u'Servicemembers'}
{u'count': 22, u'term': u'Livestream'}
{u'count': 21, u'term': u'Video'}
{u'count': 21, u'term': u'Older Americans'}
{u'count': 19, u'term': u'Know Before You Owe'}
''' queries.posts.possible_values_for('tags') ''' Is all the known tags across all posts.
""" for tag in post.tags """
Is all the tags on the given posts. Is it not behaving that way?
Actually-- I think I understand the issue. It's only returning the first 10
Right, that's the issue. Sorry it wasn't clear.
I just pushed a change to sheer that should correctly return the entire universe of values for a field-- give it a try!
I've reverted that change, and am working on a new solution
OK, I'm not proud of this solution, but it should work until we have a field with more than 10,000 possible values ;)
When using
queries.posts.possible_values_for('tags')
(as seen here https://github.com/cfpb/cfgov-refresh/blob/gh-pages/blog/index.html#L146) I'm not getting the same results as when I usefor tag in post.tags
(as seen here https://github.com/cfpb/cfgov-refresh/blob/gh-pages/blog/_single.html#L85).