Я новичок в django и в настоящее время у меня проблема, которую я пытаюсь решить
Я получаю
Неизвестные поля (поля) указаны для предложения
views.py
from django.views.generic.edit import CreateView
from django.urls import reverse_lazy
from .models import Buyer, Seller, Offer
class OfferCreate(CreateView):
model = Offer
fields = ['category', 'car_brand', 'car_model', 'type', 'year_of_production', 'color', 'car_mileage', 'description',
'car_equipment', 'fuel_type', 'doors_number', 'seats_number', 'engine_capacity',
'seller', 'photos', '',]
success_url = reverse_lazy("/")
model Offer
class Offer(models.Model):
car_brand = models.CharField(max_length=64)
car_model = models.CharField(max_length=64)
category = models.IntegerField(choices=CATEGORY)
type = models.IntegerField(choices=TYPE)
year_of_production = models.SmallIntegerField()
color = models.CharField(max_length=64)
car_mileage = models.IntegerField()
description = models.TextField()
car_equipment = forms.MultipleChoiceField(choices=EQUIP)
fuel_type = models.IntegerField(choices=FUEL_TYPE)
doors_number = models.IntegerField(choices=DOORS_NUMBER)
seats_number = models.IntegerField(choices=SEATS_NUMBER)
engine_capacity = models.IntegerField()
seller = models.ForeignKey(Seller, on_delete=models.CASCADE)
photos = models.ImageField(upload_to='offers')
Есть идеи, что вызывает проблему?