Пример #1
0
 class Meta:
     model = ConferenceRegistration
     exclude = []
     widgets = {
         'attendee':
         AutoCompleteSelectWidget(lookup_class=UserLookup),
         'registrator':
         AutoCompleteSelectWidget(lookup_class=UserLookup),
         'checkedinby':
         AutoCompleteSelectWidget(lookup_class=RegistrationLookup),
     }
Пример #2
0
 class Meta:
     model = Invoice
     exclude = []
     widgets = {
         'recipient_user':
         AutoCompleteSelectWidget(lookup_class=UserLookup),
     }
Пример #3
0
 class Meta:
     model = DiscountCode
     exclude = []
     widgets = {
         'sponsor_rep':
         AutoCompleteSelectWidget(lookup_class=UserLookup),
         'registrations':
         AutoCompleteSelectMultipleWidget(lookup_class=RegistrationLookup),
     }
Пример #4
0
 class Meta:
     model = Partner
     fields = (
         'name',
         'partner_type',
         'person_count',
         'note',
         'parent',
     )
     widgets = {
         'partner_type': AutoComboboxSelectWidget(PartnerTypeLookup),
         'parent': AutoCompleteSelectWidget(PartnerLookup),
         'note': Textarea(attrs={'style': 'height:150px; width:500px'}),
     }
Пример #5
0
 class Meta:
     model = BulkPayment
     exclude = []
     widgets = {
         'user': AutoCompleteSelectWidget(lookup_class=UserLookup),
     }
Пример #6
0
 class Meta:
     model = PrepaidVoucher
     exclude = []
     widgets = {
         'user': AutoCompleteSelectWidget(lookup_class=RegistrationLookup),
     }
Пример #7
0
 class Meta:
     model = PrepaidBatch
     exclude = []
     widgets = {
         'buyer': AutoCompleteSelectWidget(lookup_class=UserLookup),
     }
Пример #8
0
class CompanyAdminApplicationForm(CompanyAdminForm, RegistrationBaseForm):
    administrated_company = forms.ModelChoiceField(
        label=_("Název společnosti"),
        widget=AutoCompleteSelectWidget(
            lookup_class='dpnk.lookups.CompanyLookup',
            attrs={
                'class':
                "autocompletewidget form-control textinput textInput form-control",
                'name': 'admin_company',
            },
        ),
        queryset=Company.objects.all(),
        required=True,
        help_text=_("Začnete psát název organizace a vyberte si z nabídky."),
    )
    telephone = forms.CharField(
        label="Telefon",
        max_length=30,
    )
    first_name = forms.CharField(
        label=_(u"Jméno"),
        max_length=30,
        required=True,
    )
    last_name = forms.CharField(
        label=_(u"Příjmení"),
        max_length=30,
        required=True,
    )
    campaign = forms.ModelChoiceField(
        widget=forms.widgets.HiddenInput(),
        queryset=Campaign.objects.all(),
        required=True,
    )
    username = forms.CharField(widget=forms.HiddenInput, required=False)

    def get_campaign(self):
        return self.initial['campaign']

    def clean_administrated_company(self):
        company = self.cleaned_data['administrated_company']
        campaign = self.get_campaign()
        if CompanyAdmin.objects.filter(
                administrated_company__pk=company.pk,
                campaign=campaign,
                company_admin_approved='approved').exists():
            raise forms.ValidationError(
                _(u"Tato organizace již má svého firemního koordinátora."))
        return company

    class Meta:
        model = User
        fields = (
            'campaign',
            'motivation_company_admin',
            'first_name',
            'last_name',
            'administrated_company',
            'email',
            'telephone',
            'password1',
            'password2',
            'username',
            'will_pay_opt_in',
            'personal_data_opt_in',
        )
Пример #9
0
 class Meta:
     model = NewsPosterProfile
     exclude = []
     widgets = {
         'author': AutoCompleteSelectWidget(lookup_class=UserLookup),
     }
Пример #10
0
class CompanyAdminApplicationForm(
        EmailUsernameMixin, CompanyAdminForm,
        registration.forms.RegistrationFormUniqueEmail):
    administrated_company = forms.ModelChoiceField(
        label=_(u"Koordinovaná organizace"),
        widget=AutoCompleteSelectWidget(
            lookup_class='dpnk.lookups.CompanyLookup', ),
        queryset=Company.objects.all(),
        required=True,
        help_text=_("Napište část názvu organizace a vyberte ji ze seznamu."),
    )
    telephone = forms.CharField(
        label="Telefon",
        help_text=_("Pro možnost kontaktování firemního koordinátora"),
        max_length=30,
    )
    first_name = forms.CharField(
        label=_(u"Jméno"),
        max_length=30,
        required=True,
    )
    last_name = forms.CharField(
        label=_(u"Příjmení"),
        max_length=30,
        required=True,
    )
    campaign = forms.ModelChoiceField(
        widget=forms.widgets.HiddenInput(),
        queryset=Campaign.objects.all(),
        required=True,
    )
    username = forms.CharField(widget=forms.HiddenInput, required=False)

    def get_campaign(self):
        return self.initial['campaign']

    def clean_administrated_company(self):
        company = self.cleaned_data['administrated_company']
        campaign = self.get_campaign()
        if CompanyAdmin.objects.filter(
                administrated_company__pk=company.pk,
                campaign=campaign,
                company_admin_approved='approved').exists():
            raise forms.ValidationError(
                _(u"Tato organizace již má svého firemního koordinátora."))
        return company

    class Meta:
        model = User
        fields = (
            'campaign',
            'motivation_company_admin',
            'first_name',
            'last_name',
            'administrated_company',
            'email',
            'telephone',
            'password1',
            'password2',
            'username',
            'will_pay_opt_in',
            'personal_data_opt_in',
        )
Пример #11
0
 class Meta:
     model = Contributor
     exclude = ()
     widgets = {
         'user': AutoCompleteSelectWidget(lookup_class=UserLookup),
     }
Пример #12
0
            self.fields['city'].queryset = models.City.objects.filter(
                cityincampaign__campaign=self.campaign)

    class Meta:
        model = models.Subsidiary
        fields = ('city', 'address_recipient', 'address_street',
                  'address_street_number', 'address_psc', 'address_city')


company_field = forms.ModelChoiceField(
    label=_("Organizace"),
    queryset=models.Company.objects.filter(active=True),
    widget=AutoCompleteSelectWidget(
        lookup_class='dpnk.lookups.CompanyLookup',
        attrs={
            'autocomplete': 'off',
            'class': "autocompletewidget form-control",
        },
    ),
    required=True,
    help_text=_(
        "Napište několik začátečních písmen celého názvu svého zaměstnavatele a pokud již existuje, nabídne se vám k výběru. "
        "Vyberte ji kliknutím na položku v seznamu.", ),
)


class RegisterSubsidiaryForm(AddressForm):
    company = company_field

    def clean_company(self):
        return self.company