Created
August 23, 2013 16:12
-
-
Save kiotokun/6321114 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| from django.db import models | |
| from disolution.models import * | |
| from django import forms | |
| class SalesForm(forms.Form): | |
| sales_id = forms.CharField(widget=forms.HiddenInput()) | |
| title = forms.CharField( | |
| label='Заголовок:', initial='', max_length=255, | |
| error_messages={'required': 'Обязательное поле','max_length':'Слишком длинный заголовок'}, | |
| widget=forms.TextInput(attrs={'class':'span10','placeholder':''}) | |
| ) | |
| content = forms.CharField( | |
| label='Содержание:', initial='', min_length=10, | |
| error_messages={'required': 'Обязательное поле','min_length':'Пожалуйста напишите немного больше'}, | |
| widget=forms.Textarea(attrs={'class':'span10','rows':'','cols':''}) | |
| ) | |
| image = forms.ImageField(required=False, label='Изображение:') | |
| class BrendForm (forms.Form): | |
| name = forms.CharField( | |
| label='Название бренда', | |
| initial='', | |
| max_length=255, | |
| error_messages={'required':'Пожалуйста введите название бренда', 'max_length': 'Слишком длинное название'}, | |
| widget=forms.TextInput(attrs={'class':'span10','placeholder':'Например: Toshiba'}) | |
| ) | |
| link = forms.CharField( | |
| label='Ссылка', | |
| required=False, | |
| initial='', | |
| max_length=255, | |
| error_messages={'max_length': 'Слишком длинная ссылка'}, | |
| widget=forms.TextInput(attrs={'class':'span10','placeholder':'Например: http://multy-service.ru/svarochnaja_tehnika/'}) | |
| ) | |
| photo = forms.ImageField(label='Изображение:') | |
| class SlideForm (forms.Form): | |
| link = forms.CharField( | |
| label='Ссылка', | |
| required=False, | |
| initial='', | |
| max_length=255, | |
| error_messages={'max_length': 'Слишком длинная ссылка'}, | |
| widget=forms.TextInput(attrs={'class':'span10','placeholder':'Например: http://multy-service.ru/svarochnaja_tehnika/'}) | |
| ) | |
| description = forms.CharField( | |
| label='Описание слайда', | |
| required=False, | |
| initial='', | |
| widget=forms.Textarea(attrs={'class':'span10','rows':'','cols':''}) | |
| ) | |
| photo = forms.ImageField(label='Изображение:') | |
| class PictureForm (forms.Form): | |
| title = forms.CharField( | |
| label='Название', | |
| required=False, | |
| initial='', | |
| max_length=255, | |
| error_messages={'max_length': 'Слишком длинная ссылка'}, | |
| widget=forms.TextInput(attrs={'class':'span10','placeholder':'Например: Сертификат BlueWeld'}) | |
| ) | |
| photo = forms.ImageField(label='Изображение:') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment