django-markupwiki/markupwiki/forms.py
2010-03-30 16:17:42 -04:00

18 lines
498 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', False)
class ArticleForm(forms.ModelForm):
class Meta:
model = ArticleVersion
fields = ['body']
if MARKUP_TYPE_EDITABLE:
fields.append('body_markup_type')
class StaffModerationForm(forms.ModelForm):
class Meta:
model = Article
fields = ['status']