I\'ve Django model which has foreign keys associated with other models. Each model is having same field names(attributes) created_at and updated_at
In every django q
Got the solution.
data = list(Model.objects.extra(select={'date':"to_char(_.created_at, 'YYYY-MM-DD hh:mi AM')"}).values_list('date', flat='true')
It's not just tablename.attribute, it should be dbname_tablename.attribute when we have multiple databases(ambiguous)
which will result list of created_at datetime values trimmed to 'YYYY-MM-DD HH:MM' format.