urls.py 2 KB
Newer Older
1
# core django imports
Daniel W Bond's avatar
Daniel W Bond committed
2
from django.conf.urls import patterns, url
Daniel W Bond's avatar
Daniel W Bond committed
3
from django.views.decorators.cache import cache_page
4
5
# imports from your apps
from .views import ListListings, CreateListing, ListingPage,\
6
7
    CreateFlag, DeleteFlag, EditListing, ExchangeListing,\
    UnExchangeListing, CancelListing, ReopenListing, CreateRating,\
8
    EditRating, DeleteRating, EditBid, DeleteListing
9
10


Daniel W Bond's avatar
Daniel W Bond committed
11
urlpatterns = patterns('',
12
    url(r'^all/$',
13
        cache_page(60 * 2)(ListListings.as_view()), name='list_listings'),
14
15

    url(r'^new/$',
16
        CreateListing.as_view(), name='create_listing'),
17

Daniel W Bond's avatar
Daniel W Bond committed
18
    url(r'^listing/(?P<slug>[\w-]+)/$',
19
        cache_page(12)(ListingPage.as_view()), name='detail_listing'),
20

21
22
23
    url(r'^listing/(?P<slug>[\w-]+)/delete/$',
        DeleteListing.as_view(), name='delete_listing'),

Daniel W Bond's avatar
Daniel W Bond committed
24
    url(r'^listing/(?P<listing_slug>[\w-]+)/bid/(?P<slug>[\w-]+)/edit/$',
Daniel W Bond's avatar
Daniel W Bond committed
25
26
        EditBid.as_view(), name='edit_bid'),

Daniel W Bond's avatar
Daniel W Bond committed
27
    url(r'^listing/(?P<slug>[\w-]+)/flag/$',
28
        CreateFlag.as_view(), name='create_flag'),
Daniel W Bond's avatar
Daniel W Bond committed
29
30

    url(r'^listing/(?P<listing_slug>[\w-]+)/flag/(?P<slug>[\w-]+)/remove/$',
31
        DeleteFlag.as_view(), name='delete_flag'),
Daniel W Bond's avatar
Daniel W Bond committed
32

33
    url(r'^listing/(?P<slug>[\w-]+)/edit/$',
34
        EditListing.as_view(), name='edit_listing'),
Daniel W Bond's avatar
Daniel W Bond committed
35

36
    url(r'^listing/(?P<slug>[\w-]+)/exchange/$',
37
        ExchangeListing.as_view(), name='exchange_listing'),
38

39
    url(r'^listing/(?P<slug>[\w-]+)/unexchange/$',
40
        UnExchangeListing.as_view(), name='unexchange_listing'),
41
42

    url(r'^listing/(?P<slug>[\w-]+)/cancel/$',
43
        CancelListing.as_view(), name='cancel_listing'),
44
45

    url(r'^listing/(?P<slug>[\w-]+)/reopen/$',
46
        ReopenListing.as_view(), name='reopen_listing'),
Daniel W Bond's avatar
Daniel W Bond committed
47
48
49
50
51
52
53
54
55
56

    url(r'^listing/(?P<slug>[\w-]+)/rate/$',
        CreateRating.as_view(), name='create_rating'),

    url(r'^listing/(?P<listing_slug>[\w-]+)/rating/(?P<slug>[\w-]+)/edit/$',
        EditRating.as_view(), name='edit_rating'),

    url(r'^listing/(?P<listing_slug>[\w-]+)/rating/(?P<slug>[\w-]+)/remove/$',
        DeleteRating.as_view(), name='delete_rating'),

57
)