I am transferring some legacy posts into a new Django blog. In my script, I have the following code:
title=['title'], slug=['slug'], chron_date=['chron_date'],
The problem is that the date, time, and datetime fields all refuse to take a variable, or, they all treat the intended variable as a literal string, which generates errors. The only solution I’ve found is the one you see for clock, where I have to hard code a literal string. This means I have to go back through the posts one at a time to manually correct the dates and times.
Why do the date and time objects work this way?
Is this the only workaround, or am I missing something that would allow me to use a variable and loop through all the actual dates and get them imported?