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

rejectattr with equalto filter is not working #82

Closed
garfieldgroup opened this issue Oct 14, 2016 · 2 comments
Closed

rejectattr with equalto filter is not working #82

garfieldgroup opened this issue Oct 14, 2016 · 2 comments

Comments

@garfieldgroup
Copy link

I believe this issue is the same as issue #78, except that rejectattr is concerned.

topics|rejectattr("name", "equalto", "News")

TemplateSyntaxException: com.hubspot.jinjava.interpret.InterpretException: equalto test requires 1 argument

@aliameer
Copy link

aliameer commented Nov 6, 2016

I've faced the same issue with the rejectattr filter.

A typical use case for the rejectattr filter is when one wants to "reject" the current blog post from a list of blog posts fetched that are to be shown in a "related blog posts" section.

One would do, some_blog_posts|rejectattr("absolute_url", "equalto", content.absolute_url)

But the above produces,
TemplateSyntaxException: com.hubspot.jinjava.interpret.InterpretException: equalto test requires 1 argument

Of course, we can work around this using an if/unless statement as described in,
http://designers.hubspot.com/tutorials/creating-a-related-post-section-with-hubl

I used to face a similar issue with the selectattr filter; however, it seems to be fixed following #80

@boulter
Copy link
Contributor

boulter commented Nov 7, 2016

Anyone interested in taking a stab at this one? It should be a similar fix as #80 .

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

3 participants