from cmsplugin_rst.models import RstPluginModel
from django import forms


help_text = '<a href="http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html">Reference</a>'

class RstPluginForm(forms.ModelForm):
    body = forms.CharField(
                widget=forms.Textarea(attrs={
                    'rows':30,
                    'cols':80,
                    'style':'font-family:monospace'
                }),
                help_text=help_text
            )
    
    class Meta:
        model = RstPluginModel
from cmsplugin_rst.models import RstPluginModel
from django import forms


help_text = '<a href="http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html">Reference</a>'

class RstPluginForm(forms.ModelForm):
    body = forms.CharField(
                widget=forms.Textarea(attrs={
                    'rows':30,
                    'cols':80,
                    'style':'font-family:monospace'
                }),
                help_text=help_text
            )
    
    class Meta:
        model = RstPluginModel
        fields = ["name", "body"]
Add "fields" attribute to ModelForm.
Add "fields" attribute to ModelForm.

  from cmsplugin_rst.models import RstPluginModel
  from django import forms
  
  
  help_text = '<a href="http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html">Reference</a>'
  
  class RstPluginForm(forms.ModelForm):
      body = forms.CharField(
                  widget=forms.Textarea(attrs={
                      'rows':30,
                      'cols':80,
                      'style':'font-family:monospace'
                  }),
                  help_text=help_text
              )
      
      class Meta:
          model = RstPluginModel
+         fields = ["name", "body"]
Add "fields" attribute to ModelForm.
## Code Before:
from cmsplugin_rst.models import RstPluginModel
from django import forms


help_text = '<a href="http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html">Reference</a>'

class RstPluginForm(forms.ModelForm):
    body = forms.CharField(
                widget=forms.Textarea(attrs={
                    'rows':30,
                    'cols':80,
                    'style':'font-family:monospace'
                }),
                help_text=help_text
            )
    
    class Meta:
        model = RstPluginModel
## Instruction:
Add "fields" attribute to ModelForm.
## Code After:
from cmsplugin_rst.models import RstPluginModel
from django import forms


help_text = '<a href="http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html">Reference</a>'

class RstPluginForm(forms.ModelForm):
    body = forms.CharField(
                widget=forms.Textarea(attrs={
                    'rows':30,
                    'cols':80,
                    'style':'font-family:monospace'
                }),
                help_text=help_text
            )
    
    class Meta:
        model = RstPluginModel
        fields = ["name", "body"]