Commits

George Notaras committed 9d32892

Added a BaseRecordModelForm.

  • Participants
  • Parent commits 99ee0b9

Comments (0)

Files changed (1)

src/powerdns_manager/forms.py

 
 
 
-class SoaRecordModelForm(forms.ModelForm):
+class BaseRecordModelForm(forms.ModelForm):
+    """Base ModelForm for Record instances.
+    
+    """
+
+
+class SoaRecordModelForm(BaseRecordModelForm):
     """ModelForm for SOA resource records.
     
     By default, PowerDNS expects the content of the SOA records to contain the
 #        return 'soa-%s' % default_prefix
 
 
-class NsRecordModelForm(forms.ModelForm):
+class NsRecordModelForm(BaseRecordModelForm):
     """ModelForm for NS resource records."""
 
     class Meta:
         return super(NsRecordModelForm, self).save(*args, **kwargs)
 
     
-class MxRecordModelForm(forms.ModelForm):
+class MxRecordModelForm(BaseRecordModelForm):
     """ModelForm for MX resource records."""
 
     class Meta:
         return super(MxRecordModelForm, self).save(*args, **kwargs)
 
 
-class SrvRecordModelForm(forms.ModelForm):
+class SrvRecordModelForm(BaseRecordModelForm):
     """ModelForm for SRV resource records."""
 
     class Meta:
     
     
 
-class GenericRecordModelForm(forms.ModelForm):
+class GenericRecordModelForm(BaseRecordModelForm):
     """Generic ModelForm for resource records.
     
     This special ModelForm manipulates the available RR types by excluding