コード例 #1
0
ファイル: forms.py プロジェクト: anabgiacometti/moondu
class NewsForm(FlaskForm):
    title_1 = StringField('Título',
                          validators=[InputRequired('Preencha este campo.')])
    image_1 = StringField('Vídeo')
    text_1 = TinyMceField(
        'Texto',
        tinymce_options={
            'toolbar':
            'bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | link | code',
            'height': "150"
        })

    title_2 = StringField('Título',
                          validators=[InputRequired('Preencha este campo.')])
    image_2 = StringField('Vídeo')
    text_2 = TinyMceField(
        'Texto',
        tinymce_options={
            'toolbar':
            'bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | link | code',
            'height': "150"
        })

    title_3 = StringField('Título',
                          validators=[InputRequired('Preencha este campo.')])
    image_3 = StringField('Vídeo')
    text_3 = TinyMceField(
        'Texto',
        tinymce_options={
            'toolbar':
            'bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | link | code',
            'height': "150"
        })
コード例 #2
0
class apiForm(Form):

    apiid = HiddenField('apiid')
    version = StringField('* Version', [validators.Length(min=1, max=64)])
    name = StringField('* Name', [validators.Length(min=1, max=64)])
    shortname = StringField('* Short description', [validators.Length(min=1, max=64)])
    method = SelectField('* Method', choices=[('',''),('GET', 'GET'), ('POST', 'POST'),('DELETE', 'DELETE'), ('PATCH', 'PATCH'), ('PUT','PUT')])
    uri = StringField('* URI', [validators.Length(min=1, max=64)])
    host = StringField('* Host', [validators.Length(min=1, max=64)])
    group = SelectField(u'* Servic/Group', choices=[('','0')])
    description = TinyMceField('Description', tinymce_options={'toolbar': 'insert | undo redo |  formatselect | bold italic backcolor  | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help'})
    params = TinyMceField('Params', tinymce_options={'toolbar': 'insert | undo redo |  formatselect | bold italic backcolor  | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help'})
    example = TinyMceField('Example', tinymce_options={'toolbar': 'insert | undo redo |  formatselect | bold italic backcolor  | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help'})
    success = TinyMceField('Success', tinymce_options={'toolbar': 'insert | undo redo |  formatselect | bold italic backcolor  | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help'})
    error = TinyMceField('Error', tinymce_options={'toolbar': 'insert | undo redo |  formatselect | bold italic backcolor  | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help'})
コード例 #3
0
ファイル: forms.py プロジェクト: kakoka/homework1
class BlogPostForm(FlaskForm):

    title = StringField(label='Title',
                        validators=[
                            validators.Length(min=4, max=140),
                        ])

    content = TinyMceField(label='Article Text',
                           validators=[validators.length(min=10, max=5000)],
                           tinymce_options={
                               'toolbar':
                               'undo | redo | bold italic | link | code',
                               'height': '200',
                               'width': '500'
                           })
    # выбираем из таблицы пользователей всех пользователей
    # get_pk - ключ, который потом записывается в полу user_id таблицы posts

    author = QuerySelectField(
        label='username',
        query_factory=lambda: current_session.query(User),
        get_pk=lambda item: item.id,
        get_label=lambda item: item.name,
        allow_blank=True,
        blank_text='select user')
コード例 #4
0
ファイル: forms.py プロジェクト: kakoka/homework1
class BlogPostForm(FlaskForm):

    title = StringField(label='Title',
                        validators=[
                            validators.Length(min=4, max=140),
                        ])

    content = TinyMceField(label='Article Text',
                           validators=[validators.length(min=10, max=5000)],
                           tinymce_options={
                               'toolbar':
                               'undo | redo | bold italic | link | code',
                               'height': '200',
                               'width': '500'
                           })
コード例 #5
0
class BlogPostForm(FlaskForm):
    title = StringField(label='Title', validators=[
        validators.Length(min=4, max=140),
    ])
    text = TinyMceField(label='Article Text',
                        validators=[validators.length(min=10, max=5000)],
                        tinymce_options={'toolbar': 'undo | redo | bold italic | link | code',
                                                                'height': '200',
                                                                'width': '1000'}
    )
    author = StringField(label='Author',
                         validators=[
                            validators.Length(min=10, max=40),
                            validators.Regexp('^[a-zA-Zа-яА-Я][a-zA-Zа-яА-Я0-9-_\.]{1,25}', message='Pishi normalno!')
     ])
コード例 #6
0
class PostForm(FlaskForm):
    title = StringField('Title', validators=[DataRequired()])
    content = TinyMceField(
        'Content',
        tinymce_options={
            'toolbar':
            'bold italic underline | link | codesample | fontselect fontsizeselect  ',
            'selector':
            'textarea',
            'plugins':
            'codesample',
            'codesample_languages': [{
                'text': 'HTML/XML',
                'value': 'markup'
            }, {
                'text': 'JavaScript',
                'value': 'javascript'
            }, {
                'text': 'CSS',
                'value': 'css'
            }, {
                'text': 'PHP',
                'value': 'php'
            }, {
                'text': 'Ruby',
                'value': 'ruby'
            }, {
                'text': 'Python',
                'value': 'python'
            }, {
                'text': 'Java',
                'value': 'java'
            }, {
                'text': 'C',
                'value': 'c'
            }, {
                'text': 'C#',
                'value': 'csharp'
            }, {
                'text': 'C++',
                'value': 'cpp'
            }]
        },
        validators=[DataRequired()])
    submit = SubmitField('Post')
コード例 #7
0
class MyForm(FlaskForm):
    text = TinyMceField(
        'My WTF TinyMCE Field label',
        tinymce_options={'toolbar': 'bold italic | link | code'})