emencia / django-blog-lotus

A weblog application with Django.
https://django-blog-lotus.readthedocs.io/
MIT License
5 stars 1 forks source link

Category tree #43

Open sveetch opened 1 year ago

sveetch commented 1 year ago

Is your feature request related to a problem? Please describe. There is only a single level of categories.

Describe the solution you'd like Category could have a parent category and so a category could have many category children.

This would result to a tree of categories. It is very basic to implement in model but more difficult to implement well in rendering and views.

We will need some performant enough code to render a category tree without making too many big querysets.

Did Category URL will have to consume multiple name to get a high URI ? This would need to validate every category name for correct relationship. Like for "Camembert" category, with parent category "Cheese", the url could be /cheese/camembert/.

There may be some missing points for this subject yet.

sveetch commented 1 year ago

I think since tags features is on the way into a 0.5.x release, multiple categories in an article become counterproductive, especially with category tree where the multiplicity will lead to very complex queryset.

Also there is a question about the article listing from a top category should be recursive to its children or not.

sveetch commented 1 year ago

The article listing should not be recursive into category children, such as "Cheese" only list its direct article and not the ones from "Camembert". However, a convenient method may exists to recursively retrieve all article from a category and its children, but it would be only for further specific usages. The category tree feature may be released without this.