Как еще я могу записать метку времени с часовым поясом в оболочке postgresql / django python? - PullRequest
2 голосов
/ 08 мая 2020

Я работаю над проектом django API с postgres db. Я также добавил файл serializers.py. Я пытаюсь проверить, что я сделал, добавив строку в базу данных через оболочку python, но я продолжаю получать эту ошибку:

django.db.utils.ProgrammingError: column "date_created" is of type timestamp with time zone but expression is of type time without time zone
LINE 1: ...bility" = NULL, "rating" = NULL, "date_created" = '00:00:00'...
                                                            ^
HINT:  You will need to rewrite or cast the expression.

Это код:

from vendor.models import Vendors
from vendor.serializers import VendorsRegisterSerializer
p  = Vendors(id=1, first_name='Flavio', last_name='Akin', email='sheeku@gmail.com', profession='plumber', username='Flanne', pin='1234', phone_number='12345678901', number_of_jobs=300, number_of_patrons=788, date_created='21:00:00 +05:00')

Я попытался заменить date_created значение '21:00:00 +05:00' на '21:00:00 EST', '21:00+05' и '21:00:00+05', но все равно получаю ту же ошибку.

Любая помощь будет оценена. Заранее спасибо.

...