예제 #1
0
from django.conf.urls.defaults import patterns, url

from views import GalleryView, GalleryDetailView, GalleryByAuthorView, GalleryThumbnailView

urlpatterns = patterns('',
    # Examples:
    url(r'^$', GalleryView.as_view(), name='gallery'),
    url(r'^(?P<pk>\d+)/$', GalleryDetailView.as_view(), name='gallery-detail'),
    url(r'^thumbnail/$', GalleryThumbnailView.as_view(), name='gallery-thumbnail'),
    url(r'^byauthor/(?P<authorname>\w+)/$', GalleryByAuthorView.as_view(), name='gallery-byauthor'),
)
예제 #2
0
from django.conf.urls.defaults import patterns, url

from views import (GalleriesView, GalleryView, PhotoView,
                   UploadToGalleryFormView, AddToGalleryFormView,
                   EditGalleryView, EditPhotoView,
                   DeleteGalleryView, DeletePhotoView)

#this urls.py is then included() in the main urls.py
urlpatterns = patterns('photomanager.views',

    url(r'^(?P<gallery_id>[\d]+)/(?P<gallery_slug_name>[\w\-]*)$', GalleryView.as_view(), name="gallery"),

    url(r'^(?P<gallery_id>[\d]+)/(?P<gallery_slug_name>[\w\-]*)/(?P<photo_id>[\d]+)/(?P<photo_slug_name>[\w\-]*)$',
        PhotoView.as_view(), name="photo"),

    url(r'^upload/$', UploadToGalleryFormView.as_view(), name="upload_to_gallery_form"),

    url(r'^add/(?P<gallery_id>[\d]+)/$', AddToGalleryFormView.as_view(), name="add_to_gallery_form"),

    url(r'^edit/(?P<gallery_id>[\d]+)/$', EditGalleryView.as_view(), name="edit_gallery"),

    url(r'^edit/(?P<gallery_id>[\d]+)/(?P<photo_id>[\d]+)/$', EditPhotoView.as_view(), name="edit_photo"),

    url(r'^delete/(?P<gallery_id>[\d]+)/$', DeleteGalleryView.as_view(), name="delete_gallery"),

    url(r'^delete/(?P<gallery_id>[\d]+)/(?P<photo_id>[\d]+)/$', DeletePhotoView.as_view(), name="delete_photo"),

    url(r'^$', GalleriesView.as_view(),
        kwargs={'text':'Welcome to all the Galleries.'}, name="galleries"),
)
예제 #3
0
from django.conf.urls import patterns, include, url
from django.contrib import admin
from views import GalleryView, GalleryPhotoView, GalleryHomeView

admin.autodiscover()

urlpatterns = patterns('',
                       url(r'^$', GalleryHomeView.as_view(), name='gallery-home'),
                       url(r'^(?P<id>\d+)/(?P<galleryslug>[-\w]+)/(?P<photoslug>[-\w]+)/$', GalleryPhotoView.as_view(),
                           name='photo-view'),
                       url(r'^(?P<id>\d+)/(?P<galleryslug>[-\w]+)/$', GalleryView.as_view(), name='gallery-view'),
)
예제 #4
0
from django.conf.urls.defaults import patterns, url

from views import GalleryView, GalleryDetailView, GalleryByAuthorView, CachedImage

urlpatterns = patterns(
    "",
    # Examples:
    url(r"^$", GalleryView.as_view(), name="gallery"),
    url(r"^(?P<pk>\d+)/$", GalleryDetailView.as_view(), name="gallery-detail"),
    url(r"^byauthor/(?P<authorname>\w+)/$", GalleryByAuthorView.as_view(), name="gallery-byauthor"),
    url(r"^image/(?P<pk>\d+)/$", CachedImage.as_view(), name="cached-image"),
)