DjangoModelFormフィールドをオーバーライドしようとすると問題が発生します。
私のmodels.pyは次のようなものです:
from django.db import models
class CadastroParticipantes(models.Model):
nome = models.CharField(max_length=50)
sobrenome = models.CharField(max_length=100)
cpf = models.CharField(max_length=14)
email = models.EmailField(max_length=100)
num_cartas_solicitadas = models.IntegerField(default=0)
def __unicode__(self):
return self.email
そして私のforms.pyはこのようなものです:
from django.forms import ModelForm
from models import *
class FormCadastroParticipante(ModelForm):
class Meta:
model = CadastroParticipantes
fields = ('nome', 'sobrenome', 'cpf', 'email')
exclude=('num_cartas_solicitadas')
widgets = { 'nome' : attrs={'title': 'Seu primeiro nome.'}}
サーバーを実行してアクセスしようとすると、次のメッセージが表示されます。
**
SyntaxError at /
invalid syntax (forms.py, line 9)
**
誰かがこれについて私を助けることができますか?
よろしくお願いします!(Y)