예제 #1
0
파일: tests.py 프로젝트: rebkwok/flexibeast
 def _post_response(self, user, data):
     url = reverse('gallery:categories')
     request = self.factory.post(url, data)
     store = _create_session()
     request.session = store
     request.user = user
     messages = FallbackStorage(request)
     request._messages = messages
     view = CategoryListView.as_view()
     return view(request)
예제 #2
0
파일: tests.py 프로젝트: rebkwok/flexibeast
 def _post_response(self, user, data):
     url = reverse('gallery:categories')
     request = self.factory.post(url, data)
     store = _create_session()
     request.session = store
     request.user = user
     messages = FallbackStorage(request)
     request._messages = messages
     view = CategoryListView.as_view()
     return view(request)
예제 #3
0
파일: urls.py 프로젝트: rebkwok/flexibeast
from django.conf import settings
from django.conf.urls import url
from gallery.views import category_detail_view, CategoryListView, CategoryUpdateView, gallery_menu_view, view_gallery

urlpatterns = [
    url(r"^$", gallery_menu_view, name="gallery"),
    url(r"^album/(?P<slug>[\w-]+)$", category_detail_view, name="category"),
    ##### VIEWS FOR STAFF USER ONLY #####
    # Category list view, show all categories in list, allow  for edit of
    # name and delete of entire category, add new category, links to category
    # detail views
    url(r"^albums/$", CategoryListView.as_view(), name="categories"),
    # Category detail view, show all images for edit/delete/add
    url(r"^albums/(?P<pk>\d+)$", CategoryUpdateView.as_view(), name="edit_category"),
]


if settings.TESTING:
    urlpatterns.append(url(r"^alternative_view$", view_gallery, name="alternative"))
예제 #4
0
파일: urls.py 프로젝트: tinyx/yitao.io
from django.conf.urls import url
from gallery.views import CategoryListView, ImageListView

urlpatterns = [
    url(r'^categories/$',
        CategoryListView.as_view(),
        name='gallery_categories'),
    url(r'^images/(?P<category>[^/]*)$',
        ImageListView.as_view(),
        name='gallery_imgaes'),
    url(r'^images/$', ImageListView.as_view(), name='gallery_imgaes'),
]
예제 #5
0
파일: tests.py 프로젝트: rebkwok/flexibeast
 def _get_response(self, user):
     url = reverse('gallery:categories')
     request = self.factory.get(url)
     request.user = user
     view = CategoryListView.as_view()
     return view(request)
예제 #6
0
파일: urls.py 프로젝트: rebkwok/flexibeast
from django.conf import settings
from django.urls import path
from gallery.views import category_detail_view, CategoryListView, \
    CategoryUpdateView, gallery_menu_view, view_gallery, gallery_website_view

app_name = 'gallery'

urlpatterns = [
    # path('', gallery_menu_view, name='gallery'),
    path('', gallery_website_view, name='gallery'),
    path('album/<slug:slug>/', category_detail_view, name='category'),
    ##### VIEWS FOR STAFF USER ONLY #####
    # Category list view, show all categories in list, allow  for edit of
    # name and delete of entire category, add new category, links to category
    # detail views
    path('albums/', CategoryListView.as_view(), name='categories'),
    # Category detail view, show all images for edit/delete/add
    path('albums/<int:pk>/',
         CategoryUpdateView.as_view(),
         name='edit_category')
]

if settings.TESTING:
    urlpatterns.append(
        path('alternative_view/', view_gallery, name='alternative'))
예제 #7
0
파일: tests.py 프로젝트: rebkwok/flexibeast
 def _get_response(self, user):
     url = reverse('gallery:categories')
     request = self.factory.get(url)
     request.user = user
     view = CategoryListView.as_view()
     return view(request)
예제 #8
0
파일: urls.py 프로젝트: tinyx/crabfactory
from django.conf.urls import url
from gallery.views import GalleryView, MotionView, CategoryListView, ImageListView

urlpatterns = [
    url(r'^categories/$', CategoryListView.as_view(), name='gallery_categories'),
    url(r'^images/$', ImageListView.as_view(), name='gallery_imgaes'),
    url(r'^cn/$', GalleryView.as_view(template_name='gallery_cn.html'), name='gallery_view'),
    url(r'^cn/motion/$', MotionView.as_view(template_name='motion_cn.html'), name='gallery_view'),
    url(r'^cn/(?P<category>[\w ]+)/$', GalleryView.as_view(template_name='gallery_cn.html'), name='gallery_view'),
    url(r'^$', GalleryView.as_view(), name='gallery_view'),
    url(r'^motion/$', MotionView.as_view(), name='motion_view'),
    url(r'^(?P<category>[\w ]+)/$', GalleryView.as_view(), name='gallery_view')
]