Quote:
Originally Posted by ownedbycats
Why does program: raw_field('date') return "None" while field('date') works?
$date and $$date get the same result.
EDIT: It happens even if I set gui_pubdate_display_format back to default.
ANOTHER EDIT: For reference, I'm using search & replace to copy to another datetime field.
|
It happens because 'date' is an alias for the (historically) real field 'timestamp'. The field() function does the translation. The raw_field() function doesn't.
Workaround: use 'timestamp' instead of 'date'.
EDIT: Also & FWIW: raw_field for dates returns 0101-01-01 00:00:00+00:00 for the unknown date because that is what is stored in the db. Up to you to know what to do with it.