Spaces:
Running
Running
File size: 1,558 Bytes
08b0b11 ef40ea8 08b0b11 ef40ea8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
from django import forms
from tecnicas.models import Modalidad
class SesionBasicNappingForm(forms.Form):
nombre_sesion = forms.CharField(max_length=255, widget=forms.TextInput(attrs={
"class": "bg-surface-ligt border-b-1 text-center w-full p-1",
"name": "nombre_sesion",
"placeholder": "Ej. Mermelada de mango picante"
}), required=False)
numero_productos = forms.IntegerField(widget=forms.NumberInput(attrs={
"class": "bg-surface-ligt p-1 border-b-1 text-center w-full",
"placeholder": "Solo números"
}), required=True)
numero_catadores = forms.IntegerField(widget=forms.NumberInput(attrs={
"class": "bg-surface-ligt p-1 border-b-1 text-center w-full",
"placeholder": "Solo números"
}), required=True)
instrucciones = forms.CharField(max_length=255, widget=forms.TextInput(attrs={
"class": "bg-surface-ligt border-b-1 text-center w-full p-1",
"placeholder": "Este campo es opcional"
}), required=False)
def __init__(self, *args, **kwargs):
super(SesionBasicNappingForm, self).__init__(*args, **kwargs)
names_mod = [
("sin modalidad", "sin modalidad"),
("sorting", "sorting"),
("perfil ultra flash", "perfil ultra flash")
]
self.fields['modalidad'] = forms.CharField(widget=forms.RadioSelect(choices=names_mod, attrs={
"class": "radio radio-lg radio-info",
"placeholder": "Seleccione una modalidad",
}), required=True, initial=names_mod[0])
|