my model:
class StackOverflowQuestion(models.Model):
published_date = models.DateTimeField(...)
template1.html:
{% load mytagsandfilters %}
{{ question.published_date|show_date_the_way_management_wants_it:"D d M Y" }}
template2.html (...basically identical to template1.html)
{% load mytagsandfilters %}
{{ another_question.published_date|show_date_the_way_management_wants_it:"D d M Y" }}
My goal: I want to remove the use of the template filter because it's duplicated in two places.
This would leave me something way cleaner:
template1.html
{% load mytagsandfilters %}
{{ question.published_date }}
template2.html
{% load mytagsandfilters %}
{{ another_question.published_date }}
so...
Q. Is there a way maybe to override a method in the StackOverflowQuestion model class to do this? Or maybe a way to subclass models.DateTimeField to do it? Or some other way?