Exemple #1
0
def studiumdings_detail(request, slug):
    if request.user.is_authenticated() and request.user.hat_guthaben():
        template_name = 'Veranstaltungen/detail_studiendings.html'
    else:
        template_name = 'Veranstaltungen/detail_studiendings_gast.html'

    return DetailMitMenue.as_view(template_name=template_name,
                                  model=Studiumdings,
                                  url_hier='/studium/%s/' % slug,
                                  context_object_name='studiumdings')(
                                      request, slug=slug)
Exemple #2
0
def eine_veranstaltung(request, slug):
    # gedoppelter code, aber die url /veranstaltungen/... wird eh bald obsolet?
    if request.user.is_authenticated():
        return DetailMitMenue.as_view(
            template_name='Veranstaltungen/detail_veranstaltung.html',
            model=Veranstaltung,
            context_object_name='veranstaltung')(request, slug=slug)
    else:
        return HttpResponse(
            'die uneingeloggte Ansicht bitte noch in Veranstaltungen.views implementieren'
        )
Exemple #3
0
def ein_buechlein(request, slug):
    return DetailMitMenue.as_view(
        template_name='Scholien/detail_buechlein.html',
        model=models.Buechlein,
        context_object_name='scholienbuechlein')(request, slug=slug)
Exemple #4
0
from django.conf.urls import url

from . import views, models
from Grundgeruest.views import ListeMitMenue, DetailMitMenue, TemplateMitMenue
from Bibliothek.views import liste_buecher

app_name = 'Bibliothek'

urlpatterns = [
    url(r'^$', liste_buecher, name='liste_alle'),
    url(r'^(?P<slug>[\w-]+)$',
        DetailMitMenue.as_view(
            template_name='Bibliothek/detail_buch.html',
            model=models.Buch,
            context_object_name='buch',
        ),
        name='detail_buch'),
    url('^aus_datei_einlesen/([\w-]*)$',
        views.aus_datei_einlesen,
        name='einlesen'),
    url('^aus_datei_einlesen$', views.aus_datei_einlesen, name='einlesen'),
]
Exemple #5
0
def ein_artikel(request, slug):
    return DetailMitMenue.as_view(template_name='Scholien/detail.html',
                                  model=models.Artikel,
                                  context_object_name='scholie')(request,
                                                                 slug=slug)