次の形式をレンダリングしたいが、djangoはエラーをスローし、理由を理解できない。前もって感謝します。NameError: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