Example #1
0
try:
    from django.urls import re_path
except ImportError:
    from django.conf.urls import url as re_path

from django.contrib import admin
from django.views.generic.edit import FormView

from captcha.tests.forms import TestWizardRecaptchaForm

#django < 2
#urlpatterns = [
#    path("admin/", admin.site.urls),
#    path(r"^form/$",
#        FormView.as_view(
#            form_class=TestWizardRecaptchaForm,
#            template_name="test_form.html",
#            success_url="/admin"
#        ),
#        name="form"
#    )
#]
urlpatterns = [
    re_path(r"admin/", admin.site.urls),
    re_path(r"form/$",
            FormView.as_view(form_class=TestWizardRecaptchaForm,
                             template_name="test_form.html",
                             success_url="/admin"),
            name="form")
]
Example #2
0
from django.views.generic.base import TemplateView
from django.views.generic.edit import FormView

from test_project.forms import TestForm


# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = [
    # Examples:
    # url(r'^$', 'test_project.views.home', name='home'),
    # url(r'^test_project/', include('test_project.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),
    url(r'^$', TemplateView.as_view(template_name='home.html'), name='home'),
    url(
        r'^form/$',
        FormView.as_view(
            form_class=TestForm,
            template_name='test.html',
            success_url='/'),
        name='test_form'
    ),
]
Example #3
0
                '%s students without matrikel created.' \
                    % len(self.stats['nomatr']))
        if self.stats['exists']:
            messages.warning(
                self.request,
                '%s matrikel numbers already exist: %s' \
                    % (len(self.stats['exists']),
                       ', '.join(self.stats['exists'])))

        return super(ImportStudentsView, self).form_valid(form)


import_students = staff_member_required(ImportStudentsView.as_view())

print_groups_opt = staff_member_required(
    FormView.as_view(template_name='student_manager/print_groups_opt.html',
                     form_class=forms.PrintGroupsOptForm))


class PrintGroupsView(ListView):
    template_name = 'student_manager/group_list.html'

    def get_queryset(self):
        students = models.Student.objects.exclude(group=None)
        if self.request.GET.get('matrikel'):
            students = students.exclude(matrikel=None)
            students = students.order_by('matrikel')
        else:
            students = students.filter(matrikel=None)
            students = students.order_by('last_name', 'first_name')
        return students
Example #4
0
from document.views import ClassifyDocView, PreviewDocView,\
    ClassifyDocDeleteView, ClassifyDocAttributeCreateView, DocumentDeleteView,\
    PermissionDocView, AuditDocView
from document.api import DocTagView, DocTagListView, DocUserPermissionView,\
    DocGroupPermissionView, DocPublicPermissionView, DocUserPermissionsView,\
    DocGroupPermissionsView, DocPublicPermissionsView, DocAttachView,\
    DocDetachView, DocNewAttachView

urlpatterns = patterns(
    '',

    #Class Based Generic Views
    (r'^document/new/classify$',
     login_required(
         FormView.as_view(
             template_name="app/document/document_classify_form.xhtml",
             form_class=DocumentClassifyForm))),
    (r'^document/new/classify/category/(?P<category>\d+)$',
     login_required(ClassifyDocView.as_view())),
    (r'^document/(?P<document>\d+)/preview',
     login_required(PreviewDocView.as_view())),
    (r'^document/(?P<document>\d+)/classify$',
     login_required(ClassifyDocView.as_view())),
    (r'^document/(?P<document>\d+)/classify/delete$',
     login_required(ClassifyDocDeleteView.as_view())),
    (r'^document/(?P<document>\d+)/classify/attribute/(?P<attribute>\d+)/add$',
     login_required(ClassifyDocAttributeCreateView.as_view())),
    (r'^document/(?P<document>\d+)/classify/category/(?P<category>\d+)$',
     login_required(ClassifyDocView.as_view())),
    (r'^document/(?P<document>\d+)/delete',
     login_required(DocumentDeleteView.as_view())),
Example #5
0
                '%s students without matrikel created.' \
                    % len(self.stats['nomatr']))
        if self.stats['exists']:
            messages.warning(
                self.request,
                '%s matrikel numbers already exist: %s' \
                    % (len(self.stats['exists']),
                       ', '.join(self.stats['exists'])))

        return super(ImportStudentsView, self).form_valid(form)

import_students = staff_member_required(ImportStudentsView.as_view())


print_groups_opt = staff_member_required(FormView.as_view(
    template_name='student_manager/print_groups_opt.html',
    form_class=forms.PrintGroupsOptForm))


class PrintGroupsView(ListView):
    template_name = 'student_manager/group_list.html'

    def get_queryset(self):
        students = models.Student.objects.exclude(group=None)
        if self.request.GET.get('matrikel'):
            students = students.exclude(matrikel=None)
            students = students.order_by('matrikel')
        else:
            students = students.filter(matrikel=None)
            students = students.order_by('last_name', 'first_name')
        return students
Example #6
0
# -*- coding: utf-8 -*-

from django import forms
from django.views.generic.edit import FormView
from djaloha.widgets import AlohaInput


class DjalohaForm(forms.Form):
    body = forms.CharField(widget=AlohaInput)


sample_form_view = FormView.as_view(template_name='form.html',
                                    form_class=DjalohaForm)
Example #7
0
from django.views.generic.base import TemplateView
from django.views.generic.edit import FormView

from maluroam.eduroam_snort.models import Blacklist, Rule, Script
from maluroam.eduroam_snort.views import UsersListView
from maluroam.eduroam_snort.forms import ActivityRangeForm
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('maluroam.eduroam_snort.views',
    # Examples:
    url(r'^$', 
        FormView.as_view(
            template_name = "eduroam_snort/dashboard.html",
            form_class = ActivityRangeForm
        ),
        name='dashboard'
    ),
    url(
        r'^user/$',
        UsersListView.as_view(),
        name="users"
    ),
    url(
        r'^user/(?P<slug>[\w-]+)$',
        TemplateView.as_view(template_name="eduroam_snort/user.html"),
        name="user"
    ),

    url(r'^settings/$', 'settings', name="settings"),
Example #8
0
from django.urls import path
from django.views.generic.edit import FormView

from dif_apps.forms import GeneratorForm
from dif_apps import views


app_name = 'dif_apps'
urlpatterns = [
    path('password-generator/', FormView.as_view(template_name="dif_apps/main_gen.html",
                                                 form_class=GeneratorForm), name='password-generator'),
    path('generate-password/', views.generate_password, name='generate-password'),
]
Example #9
0
# -*- coding: utf-8 -*-

from django import forms
from django.views.generic.edit import FormView
from djaloha.widgets import AlohaInput


class DjalohaForm(forms.Form):
    body = forms.CharField(widget=AlohaInput)

sample_form_view = FormView.as_view(template_name='form.html', form_class=DjalohaForm)