avatar
Untitled

Guest 55 16th Jan, 2020

PYTHON 1.82 KB
                                           
                         class FreeParticipantRegEditForm(ModelForm):
    def __init__(self, *args, **kwargs):
        super(FreeParticipantRegEditForm, self).__init__(*args, **kwargs)
        terms_and_conditions = reverse('common:static_page', kwargs={'slug': 'politika-konfidencialnosti'})
        accept = _("I accept")
        policy = _("the privacy policy")
        url_start = " <a target='_blank' href='%s'>" % terms_and_conditions
        url_end = '%s' % "</a>"
        result = '%s %s %s %s.' % (accept, url_start, policy, url_end)
        self.fields['agree_policy'].label = mark_safe(result)

    organisation_sphere = forms.ModelChoiceField(queryset=OrganisationSphere.objects.all(), empty_label=None,
                                                 label='Сфера деятельности')
    invite_signer = forms.ModelChoiceField(queryset=InviteSigner.objects.all(), empty_label=None,
                                           label='Приглашение за подписью')
    participate_type = forms.ModelChoiceField(queryset=ParticipateType.objects.order_by('id').exclude(slug__in = ["Staff", "Organizer", "Press"]),
                                            empty_label=None,
                                            label=_('Category of participants'))
    ai_departure_type = forms.ModelChoiceField(queryset=MovementType.objects.filter(language__slug=lang).order_by('id').all(), empty_label=None,
                                           label=_('Movement departure type'))
    ai_arrival_type = forms.ModelChoiceField(queryset=MovementType.objects.filter(language__slug=lang).order_by('id').all(), empty_label=None,
                                           label=_('Movement arrival type'))
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data
Recent Pastes