Commit 48bd6b3d authored by Daniel W Bond's avatar Daniel W Bond
Browse files

began transition to app-divided urls

parent 6a516450
......@@ -14,6 +14,11 @@ handle404 = TemplateView.as_view(template_name="404.html")
handle500 = TemplateView.as_view(template_name="500.html")
urlpatterns = patterns('',
# app-level urls
url(r'^share/', include('trades.urls')),
# student urls?
#### USER PAGES ####
# home page
url(r'^$', TemplateView.as_view(template_name='index.html'), name = 'homepage'),
......@@ -23,10 +28,6 @@ urlpatterns = patterns('',
url(r'^u/(?P<username>\w+)/create-lookout/?$', 'website.views.create_lookout', name = 'create_lookout'),
#### LISTING PAGES ####
# global new listings page
url(r'^listings/?$', 'website.views.all_listings', name = 'all_listings'),
# create new listing
url(r'^listings/create/?$', 'website.views.create_listing', name = 'create_listing'),
# book listing page
url(r'^listings/(?P<book_id>\d+)$', 'website.views.view_listing', name = 'view_listing'),
......
from django.conf.urls import patterns, include, url
from account.views import ListListings
from trades.models import Listing
urlpatterns = patterns('',
url(r'^all/$',
ListListings.as_view(
model=Listing,
paginate_by = 25
queryset=Listing.objects.all().order_by('-created')
context_object_name='listings',
template_name='listListings.html'),
name='all_listings'),
url(r'^new/$',
CreateListing.as_view(
model=Listing,
template_name='createListing.html'),
name='createListing'),
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment