Django HINT: Вам нужно переписать или привести выражение./ ProgrammingError
Я использую Django и получил эту ошибку при миграции
ProgrammingError at /admin/images/data/add/
column "order_data" is of type integer but expression is of type date
LINE 1: ...Babies_name", "Age_name", "Images") VALUES (1234, '2021-09-0...
^
HINT: You will need to rewrite or cast the expression.
Request Method: POST
Request URL: http://localhost:8000/admin/images/data/add/
Django Version: 3.2.7
Exception Type: ProgrammingError
Exception Value:
column "order_data" is of type integer but expression is of type date
LINE 1: ...Babies_name", "Age_name", "Images") VALUES (1234, '2021-09-0...
^
HINT: You will need to rewrite or cast the expression.
Exception Location: C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\backends\utils.py, line 84, in _execute
Python Executable: C:\Users\Admin\AppData\Local\Programs\Python\Python39\python.exe
Python Version: 3.9.7
Python Path:
['D:\\vikram\\Django\\psi',
'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python39\\python39.zip',
'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python39\\DLLs',
'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python39\\lib',
'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python39',
'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages']
Server time: Wed, 08 Sep 2021 20:41:59 +0000
from django.db import models
# Create your models here.
class data(models.Model):
order_id = models.IntegerField()
order_data = models.DateField()
Babies_name = models.CharField(max_length=100)
Age_name = models.IntegerField()
Images = models.ImageField(upload_to='photo')