Skip to content
Snippets Groups Projects
Select Git revision
  • 4f7de021329389343d61515bdbe86d799249f2c6
  • main default protected
  • docker
  • feature-tracker
  • fix-api
  • feature-event-wizard
  • feature-akslides
  • fix-history-interest
  • feature-constraint-checking-wip
  • feature-constraint-checking
10 results

models.py

Blame
  • Forked from KIF / AKPlanning
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    forms.py 999 B
    from django import forms
    from django.utils.translation import gettext_lazy as _
    
    from AKModel.models import AK
    
    
    class AKInterestForm(forms.ModelForm):
        """
        Form for quickly changing the interest count and notes of an AK
        """
        required_css_class = 'required'
    
        class Meta:
            model = AK
            fields = ['interest',
                      'notes',
                      ]
    
    
    class AKAddSlotForm(forms.Form):
        """
        Form to create a new slot for an existing AK directly from scheduling view
        """
        start = forms.CharField(label=_("Start"), disabled=True)
        end = forms.CharField(label=_("End"), disabled=True)
        duration = forms.CharField(label=_("Duration"), disabled=True)
        room = forms.IntegerField(label=_("Room"), disabled=True, widget=forms.HiddenInput())
        room_name = forms.CharField(label=_("Room"), disabled=True)
    
        def __init__(self, event):
            super().__init__()
            self.fields['ak'] = forms.ModelChoiceField(event.ak_set.all(), label=_("AK"))