예제 #1
0
파일: urls.py 프로젝트: martinsv/velo.lv
# coding=utf-8
from __future__ import unicode_literals
from django.conf.urls import patterns, url
from django.utils.translation import ugettext_lazy as _
from gallery.views import PhotoListView, AlbumListView, AlbumAssignNumberView


urlpatterns = patterns('',
                       url(_(r'^$'), AlbumListView.as_view(), name='album'),
                       url(_(r'^(?P<album_pk>\d+)/$'), PhotoListView.as_view(), name='album'),
                       url(_(r'^(?P<album_pk>\d+)/(?P<pk>\d+)/assign_numbers/$'), AlbumAssignNumberView.as_view(), name='photo_number_assign'),
)
예제 #2
0
from django.conf.urls import patterns, url

from gallery import views
from gallery.views import PhotoListView, PhotosByTagListView

urlpatterns = patterns('',
                       url(r'^$', PhotoListView.as_view(), name='index'),
                       url(r'^update_db/$', views.update, name='update'),
                       url(r'^([\w-]+)/$', PhotosByTagListView.as_view()),
                       )
예제 #3
0
    def image_url(self, instance):
        return reverse("serve-photo", kwargs={"pk": instance.pk})

    def gallery_url(self, instance):
        return reverse("gallery-instance", kwargs={"pk": instance.gallery_id})

    def url(self, instance):
        return reverse("photo-instance", kwargs={"pk": instance.pk})


urlpatterns = patterns(
    "",
    # url(r'^$', GalleryOverviewView.as_view(), name ='gallery-overview'),
    url(r"^$", ListModelView.as_view(resource=GalleryResource), name="gallery-index"),
    # url(r'^uploads$', PhotoListView.as_view(resource=PhotoResource), name='photos-current-user'),
    url(r"^(?P<gallery>\w+)/photos$", never_cache(PhotoListView.as_view(resource=PhotoResource)), name="photo-list"),
    # url(r'^(?P<gallery>\w+)/photos(/)?\?ordering=(?P<ordering>\w+)$', never_cache(PhotoListView.as_view(resource=PhotoResource)), name='photo-list'),
    # url(r'^(?P<gallery>\w+)/photos/(?P<user>\w+)\?ordering=(?P<ordering>\w+)$', never_cache(PhotoListView.as_view(resource=PhotoResource)), name='photo-list'),
    url(
        r"^(?P<gallery>\w+)/photos/(?P<user>\w+)$",
        never_cache(PhotoListView.as_view(resource=PhotoResource)),
        name="photo-list",
    ),
    url(r"^(?P<pk>\w+)$", GalleryListView.as_view(resource=GalleryResource), name="gallery-instance"),
    # upload urls
    url(r"^(?P<pk>\w+)/upload$", never_cache(PhotoUploadView.as_view()), name="photo-upload"),
    url(
        r"^(?P<pk>\w+)/(?P<user_id>\w+)/postupload$",
        never_cache(PostPhotoUploadView.as_view(resource=PhotoResource)),
        name="photo-upload-user",
    ),
예제 #4
0
from django.conf.urls import include, url
from django.contrib import admin

from django.conf.urls.static import static
from django.conf import settings

from blog.views import PostCreateView, PostDetailView, PostUpdateView, PostDeleteView, index
from gallery.views import PhotoCreateView, PhotoListView

# AjaxPhotoUploadView,     url(r'^(?P<pk>\d+)/ajax-upload/$', AjaxPhotoUploadView.as_view(), name='ajax_photo_upload_view',),

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', index, name='list'),
    url(r'^create/$', login_required(PostCreateView.as_view()), name='create'),
    url(r'^detail/(?P<pk>[0-9]+)/$', PostDetailView.as_view(), name='detail'),
    url(r'^update/(?P<pk>[0-9]+)/$',
        login_required(PostUpdateView.as_view()),
        name='update'),
    url(r'^delete/(?P<pk>[0-9]+)/$',
        login_required(PostDeleteView.as_view()),
        name='delete'),
    url(r'^photo_create/$',
        login_required(PhotoCreateView.as_view()),
        name='photo-create'),
    url(r'^photo_list/$', PhotoListView.as_view(), name='photo-list'),
    url(r'^login/$', 'django.contrib.auth.views.login'),
    url(r'^logout/$', 'django.contrib.auth.views.logout'),
    url(r'^tinymce/', include('tinymce.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
예제 #5
0
    def url(self, instance):
        return reverse('photo-instance', kwargs={
            'pk': instance.pk,
        })


urlpatterns = patterns(
    '',
    #url(r'^$', GalleryOverviewView.as_view(), name ='gallery-overview'),
    url(r'^$',
        ListModelView.as_view(resource=GalleryResource),
        name='gallery-index'),
    #url(r'^uploads$', PhotoListView.as_view(resource=PhotoResource), name='photos-current-user'),
    url(r'^(?P<gallery>\w+)/photos$',
        never_cache(PhotoListView.as_view(resource=PhotoResource)),
        name='photo-list'),
    #url(r'^(?P<gallery>\w+)/photos(/)?\?ordering=(?P<ordering>\w+)$', never_cache(PhotoListView.as_view(resource=PhotoResource)), name='photo-list'),
    #url(r'^(?P<gallery>\w+)/photos/(?P<user>\w+)\?ordering=(?P<ordering>\w+)$', never_cache(PhotoListView.as_view(resource=PhotoResource)), name='photo-list'),
    url(r'^(?P<gallery>\w+)/photos/(?P<user>\w+)$',
        never_cache(PhotoListView.as_view(resource=PhotoResource)),
        name='photo-list'),
    url(r'^(?P<pk>\w+)$',
        GalleryListView.as_view(resource=GalleryResource),
        name='gallery-instance'),

    #upload urls
    url(r'^(?P<pk>\w+)/upload$',
        never_cache(PhotoUploadView.as_view()),
        name='photo-upload'),
    url(r'^(?P<pk>\w+)/(?P<user_id>\w+)/postupload$',