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

Already on GitHub? Sign in to your account

Template tags now accept optional categories #230

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

jimr commented Apr 9, 2013

Template tags dealing with Entry objects now accept an optional
categories parameter which can be either None (default) or a
queryset of Category objects that will be used for filtering
entries. Tests updated, docs will be updated if accepted.

@jimr jimr Template tags now accept optional categories
Template tags dealing with ``Entry`` objects now accept an optional
``categories`` parameter which can be either ``None`` (default) or a
queryset of ``Category`` objects that will be used for filtering
entries. Tests updated, docs will be updated if accepted.
f70bc33
Owner

Fantomas42 commented Apr 10, 2013

Hi @jimr,

I like your idea and your work but something bothers me.
Why just applying the filters by categories only ?
It can be useful to have this behavior for the tags and the authors, and why not by a search pattern... for having a consistent API. This feature needs some refactoring and I don't think that will respect the DRY principe.

Another solution for saving and sharing your work in state, is to build a dedicated package for your templatetags implementation. If so I will make a link to your project in the ecosystem section of the documentation.

Regards

jimr commented Apr 10, 2013

I only implemented filtering by categories since that was our requirement, but the next logical step I saw was indeed to at least add filtering by tags. Do you think adding something like a **filter_kwargs parameter instead of categories=None would work? What other attributes do you think it would be useful to filter on (author, date, ...)?

For now, we can package our fork & use that ourselves but I am keen to get your input on how & if this can be improved so you're happy to merge upstream.

Owner

Fantomas42 commented Apr 26, 2013

Hi,
sorry for the late reply,

I think that **filter_kwargs can work since inclusion_tags can received in parameters named parameters, and it's not really ugly.

In the next steps we can imagine filtering by tags and authors. Filtering by date is also a great idea, I have never tought about it...

I will close the issue until you made some progress on this problematic, please open a new ticket when you have a dedicated package for this, to add a link to this project. Of course if your implementation kicks ass, it will be merged.

My best regards

@Fantomas42 Fantomas42 closed this Apr 26, 2013

jimr commented Apr 26, 2013

OK, no problems. I'll see how our implementation pans out & open a new ticket later if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment