My favorites | Sign in
Project Logo
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# $Id$
# ----------------------------------------------------------------------------
#
# Copyright (c) 2008 Guilherme Mesquita Gondim
#
# This file is part of django-fleshin.
#
# django-fleshin is free software under terms of the GNU General
# Public License version 3 (GPLv3) as published by the Free Software
# Foundation. See the file README for copying conditions.
#

"""
URL definitions for photos and albums.
"""

from django.conf.urls.defaults import *
from fleshin.models import Photo, Album
from fleshin.settings import FLESHIN_NUM_LATEST

photo_info_dict = {
'queryset': Photo.published_on_site.all(),
'template_object_name': 'photo',
}

photo_detail = url(
regex = '^(?P<album>[-\w]+)/(?P<slug>[-\w]+)/$',
view = 'fleshin.views.photo_detail',
kwargs = dict(photo_info_dict, slug_field='slug'),
name = 'fleshin-photo'
)
photo_list = url( # all photos + album list
regex = '^$',
view = 'django.views.generic.list_detail.object_list',
kwargs = dict(photo_info_dict, paginate_by=FLESHIN_NUM_LATEST,
extra_context={'album_list': Album.objects.all}),
name = 'fleshin-photo-list'
)
photo_album_list = url( # only photos in ``album``
regex = '^(?P<album>[-\w]+)/$',
view = 'fleshin.views.photo_list',
kwargs = dict(photo_info_dict, paginate_by=FLESHIN_NUM_LATEST),
name = 'fleshin-photo-album-list'
)

urlpatterns = patterns('', photo_detail, photo_list, photo_album_list)
Show details Hide details

Change log

r17 by semente on Apr 01, 2008   Diff
Bug fixes in url patterns.
Go to: 
Project members, sign in to write a code review

Older revisions

r16 by semente on Mar 31, 2008   Diff
Bug fixes in urls patterns and views.
r6 by semente on Mar 04, 2008   Diff
Some bug fixes.
r3 by semente on Feb 09, 2008   Diff
Initial import.
All revisions of this file

File info

Size: 1612 bytes, 48 lines

File properties

svn:eol-style
native
svn:keywords
Date Revision Author HeadURL Id
Hosted by Google Code