Files
edx-platform/lms/djangoapps/survey/admin.py
Ned Batchelder 322ca34b20 Remove pylint pragmas from "class Meta"
Also remove useless docstrings where they were added to keep pylint
quiet.
2015-10-21 07:37:00 -04:00

30 lines
686 B
Python

"""
Provide accessors to these models via the Django Admin pages
"""
from django import forms
from django.contrib import admin
from survey.models import SurveyForm
class SurveyFormAdminForm(forms.ModelForm):
"""Form providing validation of SurveyForm content."""
class Meta(object):
model = SurveyForm
fields = ('name', 'form')
def clean_form(self):
"""Validate the HTML template."""
form = self.cleaned_data["form"]
SurveyForm.validate_form_html(form)
return form
class SurveyFormAdmin(admin.ModelAdmin):
"""Admin for SurveyForm"""
form = SurveyFormAdminForm
admin.site.register(SurveyForm, SurveyFormAdmin)