Xxxx Соответствующий запрос не существует
Я пытаюсь запросить данные из csv файла в django, вот код запроса : from django.core.management.base import BaseCommand
import pandas as pd
from website.models import Product
class Command(BaseCommand):
help='import booms'
def add_arguments(self, parser):
pass
def handle(self,*args,**options):
df=pd.read_excel('tt.xlsx',engine='openpyxl')
for P_N,P_P in zip(df.Product_name,df.Price):
models=Product.objects.get(Product_Name=P_N,Product_Price=P_P)
models.save()
вот код моего models.py :
from django.db import models
# Create your models here.
class Product(models.Model):
Product_Name=models.TextField()
Product_Price=models.TextField()
#Product_Link=models.TextField()
def __str__(self):
return self.name
зная, что мой csv файл следующий: http://prntscr.com/26cjw4a
ошибка, которую я получаю: "Запрос, соответствующий продукту, не существует " http://prntscr.com/26cjw9n