django-markupwiki/markupwiki/forms.py
2010-03-31 12:02:07 -04:00

18 lines
508 B
Python

from django.conf import settings
from django import forms
from markupwiki.models import Article, ArticleVersion
MARKUP_TYPE_EDITABLE = getattr(settings, 'MARKUPWIKI_MARKUP_TYPE_EDITABLE', True)
class ArticleForm(forms.ModelForm):
class Meta:
model = ArticleVersion
fields = ['body', 'comment']
if MARKUP_TYPE_EDITABLE:
fields.append('body_markup_type')
class StaffModerationForm(forms.ModelForm):
class Meta:
model = Article
fields = ['status']