I'm currently working on a project using Django 1.11.2 with django-tables2. I use a table to display my model. The model has a DateTimeField, which is displayed correctly in a normal column but when I use a LinkColumn with this DateTimeField, the dates are displayed in a complex format like this: '2017-02-23 07:49:53.067504+00:00' instead of '23.02.2017 07:49'. The links work fine but I can't find a way to get back to the simple format.
My model in models.py:
class mymodel(models.Model):
Date = models.DateTimeField(auto_now_add=True, help_text='(Format: TT.MM.JJJJ)')
...other fields...
class Meta:
ordering = ["Date"]
verbose_name = "MyModel"
verbose_name_plural = "MyModels"
and the table:
class MyModelTable(django_tables2.Table):
Date = django_tables2.LinkColumn(viewname='MyModelView', kwargs={"id": Accessor("id")})
class Meta:
model = MyModel
exclude = {'id'}
attrs = {"class": "paleblue"}
Thanks in advance for any help or ideas.