urls.py 1.84 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,\
Daniel W Bond's avatar
Daniel W Bond committed
6
    CreateFlag, DeleteFlag, EditListing, SellListing,\
Daniel W Bond's avatar
Daniel W Bond committed
7
    UnSellListing, CancelListing, ReopenListing, CreateRating,\
Daniel W Bond's avatar
Daniel W Bond committed
8
    EditRating, DeleteRating, EditBid
9
10


Daniel W Bond's avatar
Daniel W Bond committed
11
urlpatterns = patterns('',
12
    url(r'^all/$',
Daniel W Bond's avatar
Daniel W Bond committed
13
        cache_page(60 * 5)(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
        ListingPage.as_view(), name='detail_listing'),
20

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

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

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

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

33
    url(r'^listing/(?P<slug>[\w-]+)/sell/$',
34
        SellListing.as_view(), name='sell_listing'),
35
36

    url(r'^listing/(?P<slug>[\w-]+)/unsell/$',
37
        UnSellListing.as_view(), name='unsell_listing'),
38
39

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

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

    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'),

54
)