Customising tags in Django to filter posts in Post model
问题 Quick question - I'm not sure what would be the correct way to handle this. Essentially I wish to define a custom tag which handles some logic then returns all posts of model Post which has the is_featured field set to True. I have tried a number of avenues to get this working, but none have worked. My last coherant "guess" was the following: templatetags/blog_tags.py: @register.inclusion_tag('blog/post/featured_posts.html') def show_featured_posts(count=4): """Return 4 of the most recent