Example #1
0
 class Meta:
     model = BlogPost
     fields = ['content2']
     widgets = {
         'content2': MediumEditorTextarea(),
     }
Example #2
0
    class Meta:
        model = Post
        fields = ('author', 'title', 'text')

        # Widgets / Classes for CSS
        widgets = {'text' : MediumEditorTextarea(),}
Example #3
0
class WikiAddForm(forms.ModelForm):
    title = forms.CharField(required=True,
                            widget=forms.TextInput(
                                attrs={
                                    'placeholder': 'Title',
                                    'class': 'form-control',
                                    'style': 'height:100px'
                                }))
    content = forms.CharField(required=True,
                              widget=MediumEditorTextarea(
                                  attrs={
                                      'placeholder': 'Description',
                                      'class': 'form-control',
                                      'style': 'height:100px'
                                  }))
    history = forms.CharField(required=False,
                              widget=MediumEditorTextarea(
                                  attrs={
                                      'placeholder': 'History',
                                      'class': 'form-control',
                                      'style': 'height:100px'
                                  }))
    features = forms.CharField(required=False,
                               widget=MediumEditorTextarea(
                                   attrs={
                                       'placeholder': 'Features',
                                       'class': 'form-control',
                                       'style': 'height:100px'
                                   }))
    version_history = forms.CharField(required=False,
                                      widget=MediumEditorTextarea(
                                          attrs={
                                              'placeholder': 'Version',
                                              'class': 'form-control',
                                              'style': 'height:100px'
                                          }))
    url = forms.CharField(
        required=False,
        widget=MediumEditorTextarea(attrs={
            'placeholder': 'URL',
            'class': 'form-control',
            'style': 'height:100px'
        }))
    tech_name = forms.CharField(required=False,
                                widget=MediumEditorTextarea(
                                    attrs={
                                        'placeholder': 'Technology Name',
                                        'class': 'form-control',
                                        'style': 'height:100px'
                                    }))
    website = forms.URLField(required=False,
                             widget=forms.URLInput(
                                 attrs={
                                     'placeholder': 'http://example.com',
                                     'class': 'form-control',
                                     'style': 'height:100px'
                                 }))
    eli = forms.CharField(
        required=False,
        widget=MediumEditorTextarea(attrs={
            'placeholder': 'ELI',
            'class': 'form-control',
            'style': 'height:100px'
        }))

    class Meta:
        model = Wiki
        fields = [
            'title',
            'content',
            'history',
            'features',
            'version_history',
            'url',
            'tech_name',
            'website',
            'eli',
        ]