<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
    openslides.agenda.forms
    ~~~~~~~~~~~~~~~~~~~~~~~

    Forms for the agenda app.

    :copyright: 2011 by the OpenSlides team, see AUTHORS.
    :license: GNU GPL, see LICENSE for more details.
"""

from django.forms import Form, ModelForm, IntegerField, ChoiceField, \
                         ModelChoiceField, HiddenInput, Select
from django.utils.translation import ugettext as _
from openslides.agenda.models import Item, ItemText, ItemApplication, ItemPoll, \
                                     ItemAssignment

class ItemFormText(ModelForm):
    error_css_class = 'error'
    required_css_class = 'required'
    items = Item.objects.all().filter(parent=None).order_by('weight')
    parent = ModelChoiceField(queryset=items, label=_("Parent item"))
    class Meta:
        model = ItemText
        exclude = ('closed')


class ItemFormApplication(ModelForm):
    error_css_class = 'error'
    required_css_class = 'required'
    items = Item.objects.all().filter(parent=None).order_by('weight')
    parent = ModelChoiceField(queryset=items, label=_("Parent item"))

    class Meta:
        model = ItemApplication
        exclude = ('closed')


class ItemFormPoll(ModelForm):
    error_css_class = 'error'
    required_css_class = 'required'
    items = Item.objects.all().filter(parent=None).order_by('weight')
    parent = ModelChoiceField(queryset=items, label=_("Parent item"))

    class Meta:
        model = ItemPoll
        exclude = ('closed')


class ItemFormAssignment(ModelForm):
    error_css_class = 'error'
    required_css_class = 'required'
    items = Item.objects.all().filter(parent=None).order_by('weight')
    parent = ModelChoiceField(queryset=items, label=_("Parent item"))<commit_msg>Fixed: parent form field is not required.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
    openslides.agenda.forms
    ~~~~~~~~~~~~~~~~~~~~~~~

    Forms for the agenda app.

    :copyright: 2011 by the OpenSlides team, see AUTHORS.
    :license: GNU GPL, see LICENSE for more details.
"""

from django.forms import Form, ModelForm, IntegerField, ChoiceField, \
                         ModelChoiceField, HiddenInput, Select
from django.utils.translation import ugettext as _
from openslides.agenda.models import Item, ItemText, ItemApplication, ItemPoll, \
                                     ItemAssignment

class ItemFormText(ModelForm):
    error_css_class = 'error'
    required_css_class = 'required'
    items = Item.objects.all().filter(parent=None).order_by('weight')
    parent = ModelChoiceField(queryset=items, label=_("Parent item"), required=False)
    class Meta:
        model = ItemText
        exclude = ('closed')


class ItemFormApplication(ModelForm):
    error_css_class = 'error'
    required_css_class = 'required'
    items = Item.objects.all().filter(parent=None).order_by('weight')
    parent = ModelChoiceField(queryset=items, label=_("Parent item"), required=False)

    class Meta:
        model = ItemApplication
        exclude = ('closed')


class ItemFormPoll(ModelForm):
    error_css_class = 'error'
    required_css_class = 'required'
    items = Item.objects.all().filter(parent=None).order_by('weight')
    parent = ModelChoiceField(queryset=items, label=_("Parent item"), required=False)

    class Meta:
        model = ItemPoll
        exclude = ('closed')


class ItemFormAssignment(ModelForm):
    error_css_class = 'error'
    required_css_class = 'required'
    items = Item.objects.all().filter(parent=None).order_by('weight')
    parent = ModelChoiceField(queryset=items, label=_("Parent item"), required=False)
{'fraction_non_alphanumeric': 0.12663755458515283, 'fraction_numerical': 0.0027292576419213972, 'mean_word_length': 3.5246913580246915, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5599557', 'n_tokens_mistral': 1066, 'n_tokens_neox': 1039, 'n_words': 239}