다음 양식을 렌더링하고 싶지만 django가 오류를 발생시키고 이유를 이해하지 못합니다. 미리 감사드립니다.NameError : name 'Name'이 django 양식에 정의되어 있지 않습니다.
forms.py :
from django import forms
from .models import equipment
class neweqForm(forms.ModelForm):
class Meta:
model = equipment
name = forms.CharField(label=Name, max_lenght=100)
fabricator = forms.CharField(label=Hersteller, max_lenght=100)
storeplace = forms.IntegerField(label=Regal)
labour = forms.ChoiceField(label=Gewerk)
models.py :
from __future__ import unicode_literals
from django.db import models
# Create your models here.
class equipment(models.Model):
name = models.CharField(max_length=30)
fabricator = models.CharField(max_length=30)
storeplace = models.IntegerField()
labor_choices = (
('L', 'Licht'),
('T', 'Ton'),
('R', 'rigging'),
)
labor = models.CharField(max_length=1, choices=labor_choices)
오류 :
NameError: name 'Name' is not defined
어리석은 오류! 당신의 도움을 주셔서 감사합니다. – nictec