Beispiel #1
0
class ApplicantForm(forms.ModelForm):
    class Meta:
        model = Applicant
        widgets = {
            'total_income':
            NumberInput(attrs={
                'style': 'text-align:right;',
                'step': .01
            }),
            'adjusted_available_income':
            NumberInput(attrs={
                'style': 'text-align:right;',
                'step': .01
            }),
            'calculated_payment':
            NumberInput(attrs={
                'style': 'text-align:right;',
                'step': .01
            }),
        }

    ssn = USSocialSecurityNumberField(required=False, label="SSN")
    siblings = AutoCompleteSelectMultipleField('all_student', required=False)
    parent_guardians = AutoCompleteSelectMultipleField('emergency_contact',
                                                       required=False)
    application_decision_by = AutoCompleteSelectField('faculty_user',
                                                      required=False)
Beispiel #2
0
class RecursoGrupoForm(Form):
    nome = forms.CharField(label="Nome do Grupo")
    servidores = AutoCompleteSelectMultipleField(
        "servidores",
        required=False,
        help_text="Digite a matrícula ou nome do servidor")
    grupos_merge = AutoCompleteSelectMultipleField(
        "grupos",
        required=False,
        label="Importar usuários dos grupos",
        help_text="")
    grupos_exclude = AutoCompleteSelectMultipleField(
        "grupos",
        required=False,
        label="Excluir usuários dos grupos",
        help_text="")

    def __init__(self, is_update=False, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.is_update = is_update

    def clean_nome(self):
        nome = self.cleaned_data.get("nome")
        if nome and Group.objects.filter(
                name=nome).exists() and not self.is_update:
            raise ValidationError("Já existe um grupo com esse nome")
        return nome

    def clean_servidores(self):
        matriculas = self.cleaned_data["servidores"]
        if matriculas:
            validate_users(matriculas)
        return matriculas
Beispiel #3
0
class TestQuestionForm(forms.ModelForm):
    class Meta:
        model = Question
        widgets = {
            'test': forms.HiddenInput,
        }

    is_true = forms.ChoiceField(widget=forms.Select,
                                choices=((True, "True"), (False, "False")))
    benchmarks = AutoCompleteSelectMultipleField('benchmark', required=False)
    themes = AutoCompleteSelectMultipleField('theme', required=False)
    save_to_bank = forms.BooleanField(required=False)
Beispiel #4
0
class EvenementListForm(Form):
    q = CharField(label=_('Recherche libre'), required=False)
    dates = RangeSliderField(required=False)
    par_saison = BooleanField(required=False, initial=False)
    lieu = AutoCompleteSelectMultipleField('lieu',
                                           label=_('Lieu'),
                                           required=False,
                                           help_text='')
    oeuvre = AutoCompleteSelectMultipleField('oeuvre',
                                             required=False,
                                             label=_('Œuvre'),
                                             help_text='')
    individu = AutoCompleteSelectMultipleField('individu',
                                               required=False,
                                               label=_('Individu'),
                                               help_text='')
    ensemble = AutoCompleteSelectMultipleField('ensemble',
                                               required=False,
                                               label=_('Ensemble'),
                                               help_text='')

    def __init__(self, *args, **kwargs):
        queryset = kwargs.pop('queryset')

        self.helper = FormHelper()
        self.helper.form_method = 'GET'
        self.helper.form_class = 'well well-sm'
        self.helper.layout = Layout(
            Field('q', css_class='input-lg'),
            HTML('<hr/>'),
            'dates',
            HTML(SAISON_SELECT),
            HTML('<hr/>'),
            'lieu',
            'oeuvre',
            'individu',
            'ensemble',
            HTML('<hr/>'),
            Submit('',
                   _('Filtrer'),
                   css_class='btn-lg btn-block',
                   data_loading_text=_('Chargement…')),
        )

        super(EvenementListForm, self).__init__(*args, **kwargs)

        for field in self.fields.values():
            field.widget.attrs['placeholder'] = (field.label or '') + '…'
            field.label = ''

        self.fields['dates'].widget.queryset = queryset
Beispiel #5
0
class InterviewForm(ModelForm):
    class Meta:
        model = Interview
        fields = (
            'date',
            'interview_type',
            'start_time',
            'end_time',
            'modality',
            'stage',
            'comments',
            'technicians',
        )
        labels = {
            'date': 'fecha',
            'interview_type': 'tipo de entrevista',
            'start_time': 'hora de inicio',
            'end_time': 'hora de fin',
            'modality': 'modalidad',
            'stage': 'etapa',
            'comments': 'comentarios',
            'technicians': 'técnicos',
        }

    stage = AutoCompleteSelectField(
        'stage',
        label='Etapa',
        help_text='Búsqueda por RUT, nombre o ID del proyecto')
    technicians = AutoCompleteSelectMultipleField(
        'technicians', label='técnicos', help_text='Búsqueda por CI o nombre')

    def __init__(self, *args, **kwargs):
        super(InterviewForm, self).__init__(*args, **kwargs)
        for visible in self.visible_fields():
            set_attribute(visible)
Beispiel #6
0
class BroadcastAreaForm(ModelForm):
    class Meta:
        model = Broadcast
        fields = ('addressee', 'send_to_entrepreneurs', 'send_to_massive',
                  'activity', 'send_to_activity_inscriptions', 'subject',
                  'message', 'files')
        labels = {
            'addressee': 'recipientes',
            'activity': 'actividad',
            'send_to_activity_inscriptions': 'inscritos',
            'send_to_entrepreneurs': 'emprendedores',
            'send_to_massive': 'masivo',
            'subject': 'asunto',
            'message': 'mensaje',
            'files': 'archivos',
        }

    files = AutoCompleteSelectMultipleField(
        'file',
        label='Archivos',
        help_text='Búsqueda por ID o nombre',
        required=False)
    activity = AutoCompleteSelectField(
        'activity',
        label='Actividad',
        help_text=
        'Búqueda por nombre, código de inscripción o ID de la actividad',
        required=False)

    def __init__(self, *args, **kwargs):
        super(BroadcastAreaForm, self).__init__(*args, **kwargs)
        for visible in self.visible_fields():
            set_attribute(visible)
Beispiel #7
0
class BulkUpdateForm(forms.Form):
    def __init__(self, *args, **kwargs):
        self.helper = FormHelper()
        self.helper.layout = Layout(
            Field('users'), Field('date', css_class="datepick"),
            Field('pit_level'), FormActions(Submit('save', 'Save Changes'), ))
        super(BulkUpdateForm, self).__init__(*args, **kwargs)

    users = AutoCompleteSelectMultipleField(
        'Users',
        required=True,
        plugin_options={
            'position':
            "{ my : \"right top\", at: \"right bottom\", of: \"#id_person_name_text\"},'minlength':4"
        })
    date = forms.DateField()
    pit_level = forms.ModelChoiceField(queryset=PITLevel.objects.all(),
                                       empty_label=None)

    def create_updates(self):
        i = self.cleaned_data
        for user in i['users']:
            p, created = Projectionist.objects.get_or_create(user_id=user)
            PitInstance.objects.create(projectionist=p,
                                       pit_level=i['pit_level'],
                                       created_on=i['date'])
Beispiel #8
0
class AccessForm(forms.ModelForm):
    def __init__(self, *args, **kwargs):
        space = kwargs.pop('location')
        r = kwargs.pop('reason')
        self.helper = FormHelper()
        self.helper.form_class = "form-horizontal col-md-6 m-auto"
        self.helper.form_method = 'post'
        self.helper.form_action = ''
        title = "Sign in"
        if not r:
            reason_field = Field('reason')
        else:
            reason_field = Hidden('reason', value=r)
            if r == "OUT":
                title = "Sign out"
        self.helper.layout = Layout(
            HTML('<h2 class="h3">' + title +
                 '</h2><br><p><strong>Location: </strong>' + space +
                 '</p><hr>'), Field('users'), reason_field,
            FormActions(Submit('save', 'Submit')))
        super(AccessForm, self).__init__(*args, **kwargs)

    users = AutoCompleteSelectMultipleField(
        'Users',
        label="Select Members",
        help_text=
        "<span class='small'>Enter text to search. List everyone who is "
        "with you. Each member only needs to be checked in once per "
        "visit.</span><br><br>")
    reason = forms.CharField(label="Reason for visit")

    class Meta:
        model = models.AccessRecord
        fields = ('users', 'reason')
Beispiel #9
0
class IdentifiableForm(forms.ModelForm):
    authors = AutoCompleteSelectMultipleField('authors',
                                              required=True,
                                              help_text=None)

    def __init__(self, *args, **kwargs):
        super(IdentifiableForm, self).__init__(*args, **kwargs)

        for child in self.Meta.model.MetaEx.form_children:
            self.fields[child] = AutoCompleteSelectMultipleField(
                child,
                required=False,
                help_text=None,
                initial=getattr(self.instance, child).all()
                if self.instance and self.instance.id else [],
            )

    def save(self, *args, commit=True, **kwargs):
        ''' Explicitly add children for children in the reverse direction.
    '''
        instance = super(IdentifiableForm, self).save(self, *args, **kwargs)
        if commit:
            for child in self.Meta.model.MetaEx.form_children:
                child_attr = getattr(instance, child)
                if child_attr.reverse:
                    child_attr.clear()
                    for obj in self.cleaned_data[child]:
                        child_attr.add(obj)
        return instance

    class Meta:
        abstract = True
Beispiel #10
0
class ProjectForm(ModelForm):
    class Meta:
        model = Project
        fields = ('name', 'social_reason', 'rut', 'description',
                  'business_area', 'status', 'general_stage', 'entrepreneurs',
                  'postulation')
        labels = {
            'name': 'nombre',
            'social_reason': 'razón social',
            'rut': 'RUT',
            'description': 'descripción',
            'business_area': 'sector de negocios',
            'status': 'estado',
            'general_stage': 'etapa general',
            'entrepreneurs': 'emprendedores',
            'postulation': 'postulación',
        }

    entrepreneurs = AutoCompleteSelectMultipleField(
        'entrepreneurs',
        label='emprendedores',
        help_text='Búsqueda por CI o nombre')
    postulation = AutoCompleteSelectField(
        'postulation',
        label='postulación',
        help_text=
        'Búqueda por CI del postulante, nombre del postulante o nombre del proyecto'
    )

    def __init__(self, *args, **kwargs):
        super(ProjectForm, self).__init__(*args, **kwargs)
        for visible in self.visible_fields():
            set_attribute(visible)
def make_ajax_field(model,model_fieldname,channel,**kwargs):
    """ makes an ajax select / multiple select / autocomplete field
        copying the label and help text from the model's db field
    
        optional args:
            help_text - note that django's ManyToMany db field will append 
                'Hold down "Control", or "Command" on a Mac, to select more than one.'
                to your db field's help text.
                Therefore you are better off passing it in here
            label - default is db field's verbose name
            required - default's to db field's (not) blank
            """

    from ajax_select.fields import AutoCompleteField, \
                                   AutoCompleteSelectMultipleField, \
                                   AutoCompleteSelectField

    field = model._meta.get_field(model_fieldname)
    if kwargs.has_key('label'):
        label = kwargs.pop('label')
    else:
        label = _(capfirst(unicode(field.verbose_name)))
    if kwargs.has_key('help_text'):
        help_text = kwargs.pop('help_text')
    else:
        if isinstance(field.help_text,basestring):
            help_text = _(field.help_text)
        else:
            help_text = field.help_text
    if kwargs.has_key('required'):
        required = kwargs.pop('required')
    else:
        required = not field.blank

    if isinstance(field,ManyToManyField):
        f = AutoCompleteSelectMultipleField(
            channel,
            required=required,
            help_text=help_text,
            label=label,
            **kwargs
            )
    elif isinstance(field,ForeignKey):
        f = AutoCompleteSelectField(
            channel,
            required=required,
            help_text=help_text,
            label=label,
            **kwargs
            )
    else:
        f = AutoCompleteField(
            channel,
            required=required,
            help_text=help_text,
            label=label,
            **kwargs
            )
    return f
Beispiel #12
0
class QuestionBenchmarkForm(forms.ModelForm):
    class Meta:
        model = Question
        fields = [
            'benchmarks',
        ]

    benchmarks = AutoCompleteSelectMultipleField('benchmark', required=False)
Beispiel #13
0
class ObjectSearchForm(forms.Form):
    q = AutoCompleteSelectMultipleField(
        'objects',
        required=False,
        help_text=_("Search by name, code or CAS number"))
    all_labs = forms.BooleanField(widget=forms.CheckboxInput,
                                  required=False,
                                  label="All labs")
Beispiel #14
0
class ReleaseForm(forms.ModelForm):

    resources = AutoCompleteSelectMultipleField(
        'resources', required=True, help_text=_('Search for a resource'))

    # FIXME: Weird, the following message should be displayed by default, but
    # it was necessary to make it explicit here be able to display the correct
    # 'invalid' message for datetime fields, which has a suggestion of the
    # format to be used.
    error_messages = {
        'invalid':
        _('Enter a valid date/time in '
          'YYYY-MM-DD HH:MM[:ss[.uuuuuu]] format.')
    }
    release_date = forms.DateTimeField(required=False,
                                       error_messages=error_messages)
    stringfreeze_date = forms.DateTimeField(required=False,
                                            error_messages=error_messages)
    develfreeze_date = forms.DateTimeField(required=False,
                                           error_messages=error_messages)

    class Meta:
        model = Release

    def __init__(self, project, user, *args, **kwargs):
        super(ReleaseForm, self).__init__(*args, **kwargs)
        projects = self.fields["project"].queryset.filter(slug=project.slug)
        self.fields["project"].queryset = projects
        self.fields["project"].empty_label = None
        self.user = user

        if not project.is_hub:
            queryset = Resource.objects.filter(project=project)
            self.fields["resources"] = forms.ModelMultipleChoiceField(
                queryset=queryset,
                required=True,
                help_text=_(
                    'Select the resources to add to the Release. '
                    'Once this project is not a Project Hub, it is only '
                    'possible to choose resources that belong to this '
                    'project.'))

    def clean_resources(self):
        resources_list = self.cleaned_data['resources']
        for resource in resources_list:
            if not isinstance(resource, Resource):
                try:
                    resource = Resource.objects.select_related().get(
                        pk=int(resource))
                except Resource.DoesNotExist, e:
                    raise ValidationError(_("Invalid resource used."))
            if resource.project.private:
                if self.user not in resource.project.maintainers.all():
                    raise ValidationError(
                        _("%s is an inaccessible private resource. "
                          "Remove it!" % resource.name))
        return resources_list
Beispiel #15
0
class StudentForm(forms.ModelForm):
    class Meta:
        model = StudentWorker

    ssn = USSocialSecurityNumberField(required=False)
    state = USStateField(required=False)
    zip = USZipCodeField(required=False)
    emergency_contacts = AutoCompleteSelectMultipleField('emergency_contact',
                                                         required=False)
Beispiel #16
0
class GroupMembershipForm(BSModelForm):
    class Meta:
        model = GroupMembership
        fields = '__all__'

    # member = AutoCompleteSelectField('member', required=True, help_text=None)
    member = AutoCompleteSelectMultipleField('member',
                                             required=True,
                                             help_text=None)
Beispiel #17
0
class StudentSelectForm(TimeBasedForm):
    """ Generic student selection form."""
    all_students = forms.BooleanField(required=False, widget=forms.CheckboxInput(attrs={'onclick':''}))
    student = AutoCompleteSelectMultipleField('student', required=False)
    sort_by = forms.ChoiceField(choices=(('lname', 'Student last name'), ('year', 'School year'), ('cohort', 'Primary Cohort')), initial=1)
    filter_year = forms.ModelMultipleChoiceField(required=False, queryset=GradeLevel.objects.all())
    filter_cohort = forms.ModelMultipleChoiceField(required=False, queryset=Cohort.objects.all())
    
    def get_template(self, request):
        if self.cleaned_data['template']:
            # use selected template
            template = self.cleaned_data['template']
            if template.file:
                return template.file.path
            else:
                messages.error(request, 'Template not found')
        else:
            # or use uploaded template, saving it to temp file
            template = request.FILES['upload_template']
            tmpfile = mkstemp()[1]
            f = open(tmpfile, 'wb')
            f.write(template.read())
            f.close()
            return tmpfile
    
    def get_students(self, options, worker=False):
        """ Returns all students based on criteria. data should be form.cleaned_data """
        if worker:
            from ecwsp.work_study.models import StudentWorker
            students = StudentWorker.objects.all()
        else:
            students = Student.objects.all()
        
        # if selecting individual students, don't filter out deleted
        # why? Because it's unintuitive to pick one student, forgot about "include
        # deleted" and hit go to recieve a blank sheet.
        if not options['all_students']:
            students = students.filter(id__in=options['student'])
        elif not options['include_deleted']:
            students = students.filter(inactive=False)
        
        if options['student'].count == 1:
            data['student'] = options['student'][0]
            
        if options['sort_by'] == "year":
            students = students.order_by('year', 'lname', 'fname')
        elif options['sort_by'] == "cohort":  
            students = students.order_by('cache_cohort', 'lname', 'fname')
        
        if options['filter_year']:
            students = students.filter(year__in=options['filter_year'])
        
        if options['filter_cohort']:
            students = students.filter(cohorts__in=options['filter_cohort'])
        
        return students
Beispiel #18
0
class PatientRelativesForm(forms.ModelForm):
    relatives = AutoCompleteSelectMultipleField(channel='patients',
                                                required=False,
                                                help_text='',
                                                show_help_text=False,
                                                label='')

    class Meta:
        model = Patient
        fields = ('relatives', )
Beispiel #19
0
class ProblemConnectionsForm(forms.ModelForm):
    connections = AutoCompleteSelectMultipleField(channel='problems',
                                                  required=False,
                                                  help_text='',
                                                  show_help_text=False,
                                                  label='')

    class Meta:
        model = Problem
        fields = ('connections', )
Beispiel #20
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.fields['speakers'] = AutoCompleteSelectMultipleField('speakers_team_signup', required=True)
        # Only speakers that are not in any team are available for selection
        self.fields['speakers'].help_text = \
            "<p id='speakersHelp' class='form-text text-muted'>" + \
            "Start typing to search for speakers by their name.<br>" + \
            "Only speakers that are UQDS Members and are not already in a team can be selected." + \
            "</p>"
Beispiel #21
0
class FormResource(AjaxModelForm):
    description = forms.CharField(widget=MarkItUpWidget())
    kind = forms.CharField(required=False, widget=AutocompleteWithFavorites(
            ResourceKind, '/resource/search_by_kind/',
            ResourceKind.favorites(number=10), can_add=True))
    contact = forms.CharField(required=False, widget=MarkItUpWidget())
    tags = forms.Field(required=False, widget=TaggitWidget(
            autocomplete_url="/resource/search_tags/"))
    community = AutoCompleteSelectMultipleField('community', help_text='',
        required=False)
    files = FileuploadField(required=False)

    class Meta:
        model = Resource
        fields = ('name', 'description', 'kind', 'contact', 'tags', 'community',
            'id', 'files')

    _field_labels = {
        'name': _('Name'),
        'description': _('Description'),
        'kind': _('Kind'),
        'contact': _('Contact'),
        'tags': _('Tags'),
        'community': _('Community'),
        'files': _('Images'), }

    def __init__(self, *args, **kwargs):
        self.helper = MooHelper(form_id='form_resource')
        r = super(FormResource, self).__init__(*args, **kwargs)
        self.fields['name'].initial = ''
        return r

    @notify_on_update
    def save(self, *args, **kwargs):
        resource = super(FormResource, self).save(*args, **kwargs)
        UploadedFile.bind_files(
            self.cleaned_data.get('files', '').split('|'), resource)
        return resource

    def clean_kind(self):
        field_data = self.cleaned_data['kind']
        model = ResourceKind
        can_add = self.fields['kind'].widget.can_add
        try:
            if not field_data or field_data == 'None':
                if can_add and self.data.get('kind_autocomplete', ''):
                    new_kind = model(name=self.data['kind_autocomplete'])
                    new_kind.save()
                    return new_kind
                else:
                    return model()
            else:
                return model.objects.get(pk=field_data)
        except:
            raise forms.ValidationError(_('invalid field data'))
Beispiel #22
0
class BookForm(forms.ModelForm):

    publisher = AutoCompleteSelectField('publisher', required=True)
    authors = AutoCompleteSelectMultipleField('author', required=False)

    author_select = AutoCompleteField('author',
                                      required=False,
                                      label=_('Simple select field'))

    class Meta:
        model = Book
Beispiel #23
0
    def __init__(self, *args, **kwargs):
        super(IdentifiableForm, self).__init__(*args, **kwargs)

        for child in self.Meta.model.MetaEx.form_children:
            self.fields[child] = AutoCompleteSelectMultipleField(
                child,
                required=False,
                help_text=None,
                initial=getattr(self.instance, child).all()
                if self.instance and self.instance.id else [],
            )
Beispiel #24
0
class AlbumForm(ModelForm):
    class Meta:
        model = Album
        fields = '__all__'

    artist = AutoCompleteSelectMultipleField('artist',
                                             required=False,
                                             help_text="Search by name",
                                             show_help_text=False,
                                             label='Album artist')
    genre = AutoCompleteSelectMultipleField('genre',
                                            required=False,
                                            help_text="Search by name",
                                            show_help_text=False,
                                            label='Genre')

    def clean_author(self):
        if not self.cleaned_data['author']:
            return User()
        return self.cleaned_data['author']
Beispiel #25
0
class StudentMultpleAttendanceForm(forms.ModelForm):
    """ Form accepts multiple students """
    class Meta:
        model = StudentAttendance
        widgets = {
            'date': adminwidgets.AdminDateWidget(),
            'time': adminwidgets.AdminTimeWidget(),
        }
        fields = ('date', 'status', 'time', 'notes', 'private_notes')

    student = AutoCompleteSelectMultipleField('student')
Beispiel #26
0
class RelationForm(forms.ModelForm):
    class Meta:
        model = PeoplePictureRelation
        fields = ["picture"]
        widgets = {"picture": forms.HiddenInput}

    users = AutoCompleteSelectMultipleField("users",
                                            show_help_text=False,
                                            help_text="",
                                            label=_("Add user"),
                                            required=False)
class AssetModelForm(forms.Form):
    manufacturer = forms.CharField(label=_("Manufacturer"), max_length=100)
    manufacturer.widget.attrs['class'] = "form-control"

    model_name = forms.CharField(label=_("Model name"), max_length=100)
    model_name.widget.attrs['class'] = "form-control"

    model_description = forms.CharField(label=_("Model description"), widget=forms.Textarea(attrs={'rows':2}))
    model_description.widget.attrs['class'] = "form-control"

    categories = AutoCompleteSelectMultipleField('categories', label=_("Categories") )
    categories.widget.attrs['class'] = "form-control"
Beispiel #28
0
class TweetForm(forms.ModelForm):
    tag_accounts = AutoCompleteSelectMultipleField("twitterhandles",
                                                   required=False,
                                                   label="Tweeters")

    class Meta:
        model = models.Tweet
        fields = [
            'tweet_text',
            'tag_accounts',
            'status',
        ]
Beispiel #29
0
class AccountBallanceForm(forms.Form):
    date_start = forms.DateTimeField(
        label=u'C',
        required=True,
        widget=forms.widgets.DateTimeInput(attrs={'class': 'datepicker'}))
    date_end = forms.DateTimeField(
        label=u'По',
        required=False,
        widget=forms.widgets.DateTimeInput(attrs={'class': 'datepicker'}))
    accounts = AutoCompleteSelectMultipleField('account_username',
                                               label=u'Аккаунты',
                                               required=False)
Beispiel #30
0
class MeetingAdditionForm(forms.ModelForm):
    def __init__(self, *args, **kwargs):
        self.helper = FormHelper()
        self.helper.form_class = 'form-horizontal'
        self.helper.form_tag = False
        self.helper.include_media = False
        self.helper.layout = Layout(
            TabHolder(
                Tab('Basic Info', 'meeting_type', 'location',
                    Field('datetime', css_class='dtp'), 'duration'),
                Tab(
                    'Attendance',
                    'attendance',
                ),
                Tab(
                    'Agenda',
                    'agenda',
                ),
                Tab('Open Minutes', 'minutes', 'attachments'),
                Tab('Closed Minutes', 'minutes_private',
                    'attachments_private'),
            ), FormActions(Submit('save', 'Save Changes'), ))
        super(MeetingAdditionForm, self).__init__(*args, **kwargs)

    duration = NaturalDurationField(human_values=True, required=True)
    attendance = AutoCompleteSelectMultipleField('Users', required=False)
    datetime = SplitDateTimeField(required=True,
                                  initial=datetime.datetime.today())
    location = forms.ModelChoiceField(
        queryset=Location.objects.filter(available_for_meetings=True),
        label="Location",
        required=False)
    attachments = MultiFileField(
        max_file_size=1024 * 1024 * 20,  # 20 MB
        required=False)
    attachments_private = MultiFileField(
        max_file_size=1024 * 1024 * 20,  # 20 MB
        label="Closed Attachments",
        required=False)
    minutes = forms.CharField(widget=PagedownWidget(), required=False)
    agenda = forms.CharField(widget=PagedownWidget(), required=False)
    minutes_private = forms.CharField(widget=PagedownWidget(),
                                      label="Closed Minutes",
                                      required=False)

    class Meta:
        model = Meeting
        widgets = {
            'datetime': forms.widgets.DateInput(attrs={"class": "datepick"}),
        }
        fields = ('meeting_type', 'location', 'datetime', 'attendance',
                  'duration', 'agenda', 'minutes', 'minutes_private')