forms.py 1.0 KB

1234567891011121314151617181920212223242526
  1. from django.utils.translation import ugettext_lazy as _
  2. from django import forms
  3. from misago.forms import Form
  4. class QATestForm(Form):
  5. """
  6. New/Edit QA Test form
  7. """
  8. question = forms.CharField(max_length=255)
  9. helptext = forms.CharField(max_length=255, required=False)
  10. answers = forms.CharField(widget=forms.Textarea)
  11. layout = (
  12. (
  13. _("Question and Help"),
  14. (
  15. ('question', {'label': _("Test Question"), 'help_text': _("Question that is displayed to user.")}),
  16. ('helptext', {'label': _("Test Help"), 'help_text': _("Optional help text that is displayed next to question.")}),
  17. ),
  18. ),
  19. (
  20. _("Answers"),
  21. (
  22. ('answers', {'label': _("Test Answers"), 'help_text': _("Enter accepted answers to this question. Every answer should be entered in new line. Answers are case-insensitive.")}),
  23. ),
  24. ),
  25. )