我想从radioselect中删除破折号/必填字段。我不知道他们来自哪里???据我了解,它与requiredField类有关。请帮助:)
forms.py
from django import forms
from voyelo.models import User
from crispy_forms.helper import FormHelper
from crispy_forms.bootstrap import InlineRadios
class NewUserForm(forms.ModelForm):
class Meta:
model = User
fields = "__all__"
widgets = {
'comments': forms.Textarea(attrs={'rows':8, 'cols':38}),
'iletisim': forms.RadioSelect,
}
labels = {
"first_name": "İsim",
"last_name": "Soyisim",
"customer_quantity": "Kişi Sayısı",
"reservation_date": "Tarih",
"phone": "Telefon",
"email":"Email",
"iletisim":"Size Nasıl Ulaşalım?",
"comments":"Yorumlarınız",
}
models.py
from django.db import models
# Create your models here.
class User(models.Model):
ILETISIM = [
('email', 'Email'),
('arama', 'Arama'),
('whatsapp', 'Whatsapp'),
]
first_name = models.CharField(max_length=128)
last_name = models.CharField(max_length=128)
customer_quantity = models.CharField(max_length=3, null=True)
reservation_date = models.DateField(blank=True, null=True)
phone = models.CharField(max_length = 20, null=True)
email = models.EmailField(max_length=264, unique=True)
iletisim = models.CharField(max_length=8, choices=ILETISIM)
comments = models.CharField(max_length=600, null=True)