class Meta: model = models.Profile fields = [ field for field in EDITABLE_FIELDS if field not in EXCLUDE_EDITABLE_FIELDS ] widgets = { "birth_date": DateInput(attrs={"type": "date"}), "profile_photo": ej.forms.FileInput(attrs={"accept": "image/*"}), }
class Meta(UserCreationForm.Meta): model = CustomUser fields = ('first_name', 'username', 'email', 'date_of_birth') widgets = { 'first_name' : forms.TextInput(attrs={'class' : 'textfield'}), 'username' : forms.TextInput(attrs={'class' : 'textfield'}), 'email' : forms.EmailInput(attrs={'class' : 'textfield'}), 'date_of_birth' : DateInput(attrs={'type':'date'}) }
class Meta: model = task fields = [ 'title', 'task', 'task_date', 'status', 'user_id', 'comment_id', 'prioriry_id', 'list_id', 'event_id' ] widgets = { 'title': TextInput( attrs={ 'id': 'title', 'class': 'form-control', 'placeholder': 'Название задачи' }), 'task': Textarea( attrs={ 'id': 'task', 'class': 'form-control', 'placeholder': 'Текст задачи' }), 'task_date': DateInput(attrs={ 'id': 'task_date', 'class': 'form-control', }), 'status': CheckboxInput(attrs={ 'id': 'status', 'class': 'form-control', }), 'user_id': Select(attrs={ 'id': 'user_id ', 'class': 'form-control', }), 'comment_id': Select(attrs={ 'id': 'comment_id ', 'class': 'form-control', }), 'prioriry_id': Select(attrs={ 'id': 'prioriry_id ', 'class': 'form-control', }), 'list_id': Select(attrs={ 'id': 'list_id ', 'class': 'form-control', }), 'event_id': Select(attrs={ 'id': 'event_id ', 'class': 'form-control', }), }
class SubmissionExportForm(forms.Form): from_date = forms.DateField(label=('From date'), initial=timezone.now(), required=True, widget=DateInput( attrs={'type': 'datetime-local'}, format='%Y-%m-%dT%H:%M')) to_date = forms.DateField(label=('To date'), initial=timezone.now(), required=True, widget=DateInput( attrs={'type': 'datetime-local'}, format='%Y-%m-%dT%H:%M')) def __init__(self, *args, **kwargs): super(SubmissionExportForm, self).__init__(*args, **kwargs) self.fields['from_date'].widget = DateInput() self.fields['to_date'].widget = DateInput()
class Meta: model = Doctor fields = ('__all__') widgets = { 'name': TextInput(attrs={'class': 'form-control'}), 'crm': TextInput(attrs={'class': 'form-control'}), 'date_of_birth': DateInput(attrs={'class': 'form-control'}), 'specialty': Select(attrs={'class': 'form-control'}) }
class Meta: model = Patient fields = ('__all__') widgets = { 'name': TextInput(attrs={'class': 'form-control'}), 'cpf': TextInput(attrs={'class': 'form-control'}), 'date_of_birth': DateInput(attrs={'class': 'form-control'}), 'doctor': Select(attrs={'class': 'form-control'}) }
class EducationForm(ModelForm): class Meta: model = Education fields = [ 'school_name', 'school_start_date', 'school_end_date', 'best_subject', ] def __init__(self, resume, *args, **kwargs): super().__init__(*args, **kwargs) self.instance.resume = resume school_start_date = DateField(widget=DateInput(format = '%d/%m/%Y'), input_formats=('%d/%m/%Y',)) school_end_date = DateField(widget=DateInput(format = '%d/%m/%Y'), input_formats=('%d/%m/%Y',))
class Meta: model = TrainingSessionCompleted fields = ['date_completed'] labels = { 'date_completed': 'Date de la séance:', } widgets = {'date_completed': DateInput(attrs={'type': 'date'})}
class Meta: model = SubWork fields = '__all__' widgets = { 'name': TextInput(attrs={'placeholder': 'Enter name of work'}), 'dateIssued': DateInput(attrs={ 'placeholder': 'Enter date', # 'type': 'date', }), 'dateStarted': DateInput(attrs={ 'placeholder': 'Enter date', # 'type': 'date', }), 'dateCompleted': DateInput(attrs={ 'placeholder': 'Enter date', # 'type': 'date', }), 'costEstimated': NumberInput(attrs={ 'placeholder': 'Enter estimated construction cost', 'type': 'text' }), 'costActual': NumberInput(attrs={ 'placeholder': 'Enter actual construction cost', 'type': 'text' }), 'remarks': Textarea(attrs={'placeholder': 'Enter remarks'}), } labels = { 'name': 'Name of Sub-Work', 'work': 'Part of Work', 'dateIssued': 'Date Issued', 'dateStarted': 'Date Started', 'dateCompleted': 'Date Completed', 'costEstimated': 'Estimated cost', 'costActual': 'Actual cost', 'remarks': 'Remarks', }
class Meta: model = models.Objectif fields = ('title', 'description', 'poste_date', 'poste_heure', 'message') labels = { 'title': "Titre de l'objectif", 'description': 'Description', 'poste_date': 'Date de publication', 'poste_heure': 'Heure du poste', 'message': 'Message', } widgets = { 'title': TextInput( attrs={ 'class': "au-input au-input--full", "placeholder": "title of objectif" }), 'description': Textarea( attrs={ 'class': "au-input au-input--full", "placeholder": "objectif description", "rows": 2, }), 'poste_date': DateInput(attrs={ 'class': "au-input au-input--full", 'type': 'date' }), 'poste_heure': DateInput(attrs={ 'class': "au-input au-input--full", 'type': 'time' }), 'message': Textarea( attrs={ 'class': "au-input au-input--full", "placeholder": "post message", "rows": 3, }) } exclude = ('is_publish', 'create_date', 'campagne')
class Meta: model = Animal fields = '__all__' widgets = { 'owner': Select( attrs={ 'class': 'form-control', 'required': "", 'data-error': _('This field must be filled.') }), 'specie': Select( attrs={ 'class': 'form-control', 'required': "", 'onchange': 'ajax_to_filter_breed_and_color(this.value);', 'data-error': _('This field must be filled.') }), 'breed': Select( attrs={ 'class': 'form-control', 'required': "", 'data-error': _('This field must be filled.') }), 'color': Select(attrs={'class': 'form-control'}), 'fur': Select(attrs={'class': 'form-control'}), 'animal_name': TextInput( attrs={ 'class': 'form-control', 'required': "", 'data-error': _('This field must be filled.') }), 'birthdate': DateInput(attrs={'class': 'form-control datepicker'}, ), 'sex': Select(attrs={'class': 'form-control'}), 'spay_neuter': Select(attrs={'class': 'form-control'}), 'spay_neuter_date': TextInput(attrs={'class': 'form-control'}), 'microchip': TextInput(attrs={'class': 'form-control'}), 'dead': Select(attrs={'class': 'form-control'}), 'note': Textarea(attrs={ 'class': 'form-control', 'rows': '4' }), }
class Meta: model = UserProfile cicuOptions = { 'ratioWidth': '', #if image need to have fix-width ratio 'ratioHeight': '', #if image need to have fix-height ratio 'sizeWarning': 'False', #if True the crop selection have to respect minimal ratio size defined above. } fields = [ 'thumbnailURL', 'aboutMe', 'location', 'birthday', 'displayName', 'name', 'status', 'studies', 'activities', 'favouriteFood', 'favouriteSport', 'gender', 'interests' ] widgets = { 'aboutMe': Textarea( attrs={ 'class': 'form-control', 'row': '5', 'placeholder': 'Say something for you!' }), 'displayName': TextInput(attrs={'class': 'form-control'}), 'birthday': DateInput(attrs={ 'class': 'datepicker form-control', 'placeholder': 'dd/mm/yyyy' }), 'name': TextInput(attrs={'class': 'form-control'}), 'status': Textarea(attrs={'class': 'form-control'}), 'location': TextInput(attrs={ 'class': 'form-control', 'placeholder': 'πχ. Athens' }), 'studies': TextInput(attrs={'class': 'form-control'}), 'activities': TextInput(attrs={'class': 'form-control'}), 'favouriteFood': Textarea(attrs={'class': 'form-control'}), 'favouriteSport': Textarea(attrs={'class': 'form-control'}), 'interests': Textarea(attrs={'class': 'form-control'}), 'gender': TextInput(attrs={'class': 'form-control'}), 'thumbnailURL': TextInput(attrs={ 'id': 'thumbURL', 'class': 'form-control', }), }
class Meta: model = Player fields = '__all__' widgets = { 'name': TextInput( attrs={ 'type': "text", 'id': "LastName", 'name': "LastName", 'placeholder': "Nom", 'class': "input-xlarge" }), 'firstname': TextInput( attrs={ 'type': "text", 'id': "FirstName", 'name': "FirstName", 'placeholder': "Prénom", 'class': "input-xlarge" }), 'email': EmailInput( attrs={ 'type': "email", 'id': "email", 'name': "email", 'placeholder': "Adresse E-mail", 'class': "input-xlarge" }), 'dateNaissance': DateInput( attrs={ 'type': "date", 'id': "dateNaissance", 'name': "dateNaissance", 'placeholder': "Date de Naissance", 'class': "input-xlarge" }), 'pseudo': TextInput( attrs={ 'type': "text", 'id': "Pseudo", 'name': "Pseudo", 'placeholder': "Pseudo", 'class': "input-xlarge" }), # 'img_player': FileInput(attrs={ # 'type':"file", # 'name':"LastName", # 'placeholder':"Nom", # 'class':"btn btn-outline-primary" # }), }
class Meta: model = Event # datetime-local is a HTML5 input type, format to make date time show on fields # start_time = forms.DateTimeField(input_formats=['%Y-%m-%dT%H:%M'],widget=forms.DateTimeInput( attrs={'type': 'datetime-local','class': 'form-control'},format='%Y-%m-%dT%H:%M')) # end_time = forms.DateTimeField(input_formats=['%Y-%m-%dT%H:%M'],widget=forms.DateTimeInput(attrs={'type': 'datetime-local', 'class': 'form-control'},format='%Y-%m-%dT%H:%M')) widgets = { 'start_time': DateInput(attrs={'type': 'datetime-local'}, format='%Y-%m-%dT%H:%M'), 'end_time': DateInput(attrs={'type': 'datetime-local'}, format='%Y-%m-%dT%H:%M'), } # widgets ={ # 'date_for_lab': DateInput(attrs={'class':'datepicker'}, format='%Y/%m/%d'), # 'start_time': DateInput(attrs={'class':'timepicker'}, format='%H:%i:%A'), # 'end_time': DateInput(attrs={'class': 'timepicker'}, format='%H:%i:%A') # } fields = '__all__'
class Meta: model = Paciente fields = [ 'propietario', 'paciente_nombre', 'especie', 'raza', 'sexo', 'fecha_de_nacimiento', 'pelaje', 'foto' ] widgets = { 'fecha_de_nacimiento': DateInput(attrs={'class': 'datepicker'}) }
class Meta: model = Room fields = ('roomName', 'password', 'roomInfo', 'roomLimit', 'typeId') #ラベルが反映されない labes = { 'typeId': _('投票形式'), } widgets = { 'roomLimit': DateInput(), }
class Meta: model = Cotacao fields = '__all__' widgets = { 'dt_valor': DateInput(attrs={'type': "date"}), 'valor': TextInput(attrs={'class': 'form-control', 'placeholder': "Valor"}), }
class Meta: model=pedido fields=['paciente','tipo_pago','fecha','descripcion','productos'] widgets={ "fecha":DateInput( format='%d/%m/%Y', attrs={ 'id':'datepicker', 'autocomplete':"off" })}
class Meta: model = Movies fields = '__all__' widgets = { 'fecha_estreno': DateInput(attrs={'type': 'date'}), 'sinopsis': Textarea(attrs={ 'rows': 4, 'cols': 15 }) }
class Meta: model = Evento fields = ( 'data_inicio', 'data_fim', 'local', 'titulo', 'descricao', 'link', ) widgets = { 'descricao': Textarea(attrs={ 'cols': 60, 'rows': 10 }), 'data_inicio': DateInput(format="%Y-%m-%d", attrs={'type': 'date'}), 'data_fim': DateInput(format="%Y-%m-%d", attrs={'type': 'date'}) }
class Meta: model = Oportunidade exclude = ['created_at', 'updated_at'] widgets = { 'descricao': Textarea(attrs={ 'cols': 60, 'rows': 10 }), 'deadline': DateInput(format="%Y-%m-%d", attrs={'type': 'date'}), }
class Meta: model = Expense fields = ('name', 'price', 'category', 'purchase_date') labels = { 'name': 'Nazwa', 'price': 'Cena (PLN)', 'category': 'Kategoria', 'purchase_date': 'Data zakupu' } widgets = {'purchase_date': DateInput(attrs={'type': 'date'})}
class Meta: model = Event # datetime-local is a HTML5 input type, format to make date time show on fields widgets = { 'day': DateInput(attrs={'type': 'date'}, format='%Y-%m-%d'), 'inicio': TimeInput(attrs={'type': 'time'}, format='%H:%M'), #'fin': TimeInput(attrs={'type': 'time'}, format='%H:%M'), } fields = '__all__' exclude = ['status', 'date_created', 'fin']
class UserRegisterForm(UserCreationForm): email = forms.EmailField() date_of_birth = forms.DateTimeField(widget=DateInput( attrs={'type': 'date'})) class Meta: model = User fields = [ 'username', 'email', 'password1', 'password2', 'date_of_birth' ]
class Meta: model = Demande exclude = ['created_by', 'a_rembourser'] widgets = { 'num_releve ': TextInput( attrs={ 'Placeholder': 'Numéro de relevé', 'class': 'form-control', 'autocomplete': 'off' }), 'chauffeur ': Select(attrs={ 'Placeholder': 'Chauffeur', 'class': 'form-control' }), 'date_frais ': DateInput(attrs={ 'type': 'date', "format": "dd/mm/yyyy", 'class': 'form-control' }), #'date_frais ': DatePicker(options={"format": "mm/dd/yyyy","autoclose": True}), 'date_demande ': DateInput(attrs={ 'type': 'date', "format": "dd/mm/yyyy", 'class': 'form-control' }), #'date_demande ': DatePicker(options={"format": "mm/dd/yyyy","autoclose": True}), 'code_activite ': Select(attrs={'class': 'form-control'}), 'agence ': Select(attrs={'class': 'form-control'}), 'axe_analyse ': Select(attrs={'class': 'form-control'}), 'libelle_activite ': Select(attrs={'class': 'form-control'}), 'traite': CheckboxInput(), 'a_rembourser': CheckboxInput }
class Meta: model = EventCita # datetime-local is a HTML5 input type, format to make date time show on fields widgets = { 'start_time': DateInput(attrs={'type': 'date'}, format='%Y-%m-%d'), 'date_start_time': TimeInput(attrs={'type': 'time'}, format='%H:%M'), 'date_end_time': TimeInput(attrs={'type': 'time'}, format='%H:%M'), } fields = '__all__'
class Meta: model = EventModel fields = ('name', 'description', 'price', 'serves_type', 'is_child', 'is_parent', 'is_adult', 'image', 'date', 'start_time', 'end_time') widgets = { 'date': DateInput(), 'start_time': TimeInput(), 'end_time': TimeInput() }
class Meta: model = MyUser fields = [ 'first_name', 'last_name', 'phone', 'date_of_birth', 'country', 'facebook_profile' ] widgets = { 'country': CountrySelectWidget(), 'date_of_birth': DateInput(attrs={'type': 'date'}) }
class OrderFilter(FilterSet): id = NumberFilter(label=_('Estimate')) author = CharFilter(method='author_filter') client = CharFilter(method='client_filter') created__gte = DateFilter( label=_('Created from'), field_name='created', lookup_expr='gte', widget=DateInput(attrs={'placeholder': _('MM/DD/YYYY')}, ), ) created__lte = DateFilter( label=_('Created to'), field_name='created', lookup_expr='lte', widget=DateInput(attrs={'placeholder': _('MM/DD/YYYY')}, ), ) class Meta: model = Order fields = [] def __init__(self, data=None, *args, **kwargs): user = getattr(kwargs.get('request'), 'user', None) if user and not user.is_superuser: if data is None: data = QueryDict() data = data.copy() data['author'] = user.get_full_name() super(OrderFilter, self).__init__(data, *args, **kwargs) def author_filter(self, queryset, name, value): for word in value.split(): queryset = queryset.filter( Q(author__first_name__icontains=word) | Q(author__last_name__icontains=word)) return queryset def client_filter(self, queryset, name, value): return queryset.filter( Q(client__name__icontains=value) | Q(branch__name__icontains=value) | Q(branch__settlement__icontains=value) | Q(branch__address__icontains=value))
class Meta: model = Subscription fields = ['start_date'] widgets = { 'start_date': DateInput(attrs={ 'format': '%d.%m.%y', 'class': 'form-control' }), }