annotate gpp/urls.py @ 318:c550933ff5b6

Fix a bug where you'd get an error when trying to delete a forum thread (topic does not exist). Apparently when you call topic.delete() the posts would get deleted, but the signal handler for each one would run, and it would try to update the topic's post count or something, but the topic was gone? Reworked the code a bit and explicitly delete the posts first. I also added a sync() call on the parent forum since post counts were not getting adjusted.
author Brian Neal <bgneal@gmail.com>
date Sat, 05 Feb 2011 21:46:52 +0000
parents 88b2b9cb8c1f
children 0c18dfb1da1c
rev   line source
gremmie@1 1 from django.conf.urls.defaults import *
bgneal@6 2 from django.conf import settings
gremmie@1 3 from django.contrib import admin
bgneal@177 4 from django.views.decorators.cache import cache_page
bgneal@170 5
bgneal@219 6 from haystack.views import SearchView, search_view_factory
bgneal@219 7
gremmie@1 8 from news.feeds import LatestNewsFeed
bgneal@170 9 from forums.feeds import ForumsFeed
gremmie@1 10
bgneal@141 11
gremmie@1 12 admin.autodiscover()
gremmie@1 13
gremmie@1 14 urlpatterns = patterns('',
bgneal@19 15 url(r'^$', 'views.home', name='home'),
gremmie@1 16 (r'^admin/doc/', include('django.contrib.admindocs.urls')),
gremmie@1 17 (r'^admin/', include(admin.site.urls)),
gremmie@1 18 (r'^accounts/', include('accounts.urls')),
bgneal@215 19 (r'^antispam/', include('antispam.urls')),
gremmie@1 20 (r'^calendar/', include('gcalendar.urls')),
gremmie@1 21 (r'^comments/', include('comments.urls')),
gremmie@1 22 (r'^contact/', include('contact.urls')),
bgneal@127 23 (r'^core/', include('core.urls')),
bgneal@35 24 (r'^donations/', include('donations.urls')),
gremmie@1 25 (r'^downloads/', include('downloads.urls')),
bgneal@176 26 url(r'^feeds/news/$',
bgneal@177 27 cache_page(LatestNewsFeed(), 6 * 60 * 60),
bgneal@176 28 name='feeds-news'),
bgneal@176 29 url(r'^feeds/forums/$',
bgneal@177 30 cache_page(ForumsFeed(), 1 * 60 * 60),
bgneal@176 31 {'forum_slug': None},
bgneal@176 32 'feeds-forum_combined'),
bgneal@176 33 url(r'^feeds/forums/(?P<forum_slug>[\w\d-]+)/$',
bgneal@177 34 cache_page(ForumsFeed(), 1 * 60 * 60),
bgneal@176 35 name='feeds-forum'),
bgneal@81 36 (r'^forums/', include('forums.urls')),
gremmie@1 37 (r'^irc/', include('irc.urls')),
gremmie@1 38 (r'^links/', include('weblinks.urls')),
gremmie@1 39 (r'^member_map/', include('membermap.urls')),
gremmie@1 40 (r'^messages/', include('messages.urls')),
gremmie@1 41 (r'^news/', include('news.urls')),
bgneal@285 42 (r'^oembed/', include('oembed.urls')),
gremmie@1 43 (r'^podcast/', include('podcast.urls')),
gremmie@1 44 (r'^polls/', include('polls.urls')),
gremmie@1 45 (r'^potd/', include('potd.urls')),
gremmie@1 46 (r'^profile/', include('bio.urls')),
gremmie@1 47 (r'^shout/', include('shoutbox.urls')),
bgneal@12 48 (r'^smiley/', include('smiley.urls')),
gremmie@1 49 )
gremmie@1 50
bgneal@219 51 # Haystack search views
bgneal@219 52 urlpatterns += patterns('haystack.views',
bgneal@220 53 url(r'^search/$', search_view_factory(view_class=SearchView, load_all=True),
bgneal@219 54 name='haystack_search'),
bgneal@219 55 )
bgneal@219 56
bgneal@219 57
gremmie@1 58 if settings.DEBUG:
bgneal@312 59 urlpatterns += patterns('django.contrib.staticfiles.views',
bgneal@312 60 (r'^media/(?P<path>.*)$', 'serve', {'document_root': settings.MEDIA_ROOT}),
gremmie@1 61 )