So I’m throwing together a basic forum as an example and I want to display in the template the date (and I suppose username) of the last post.
So my first thought was something like this:
topics|last.post_set.all|last.created
Django does not like this and gives me a TemplateSyntaxError:
“Could not parse some characters: topics|last|.post_set.all||last.created”.
So I guess I can’t chain filters and methods and so like this.
I think I might be on the wrong track here but I’m not sure what else I can do from the template.
Any suggestions other than the obvious “do it in the view”?
If you want last item, according to some date, define
Meta.get_latest_byin both models and use