This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Pulling my hairs out with how to get this working. I am using django-tables2 to display my table data and im trying display a specific image based on the time but i need to extract the time from the datetime field of that column.
class HandoverTicketsTable(tables.Table):
date_created = ImageColumn()
class Meta:model = Ticketsattrs = {"class": "table table-striped m-b-0"}template_name = "django_tables2/bootstrap.html"fields = ("date_created","system_name","site_location","title", "notification_number",)exclude = ("incident_number", )
class ImageColumn(tables.Column):def render(self, value):return datetime.strptime(str(value),"%Y-%M-%d %H:%I:%S")
It keeps complaining about the format that im trying to extract from the value of the datetime field.
ValueError at /
unconverted data remains: .882231 00:00
Subreddit
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/django/comm...