Ejemplo n.º 1
0
from localtv.listing.views import VideoSearchView, SiteListView, CategoryVideoSearchView
from localtv.models import Category

# "Base" patterns
urlpatterns = patterns(
    "localtv.views",
    url(r"^$", "index", name="localtv_index"),
    url(r"^about/$", "about", name="localtv_about"),
    url(r"^share/(\d+)/(\d+)", "share_email", name="email-share"),
    url(r"^video/(?P<video_id>[0-9]+)/(?P<slug>[\w-]*)/?$", "view_video", name="localtv_view_video"),
    url(r"^newsletter/$", "newsletter", name="localtv_newsletter"),
)

# Listing patterns
category_videos = CategoryVideoSearchView.as_view(template_name="localtv/category.html", default_filter="category")
urlpatterns += patterns(
    "localtv.listing.views",
    url(
        r"^search/$", VideoSearchView.as_view(template_name="localtv/video_listing_search.html"), name="localtv_search"
    ),
    url(
        r"^category/$",
        SiteListView.as_view(
            template_name="localtv/categories.html", queryset=Category.objects.filter(parent=None), paginate_by=15
        ),
        name="localtv_category_index",
    ),
    url(r"^category/(?P<slug>[-\w]+)/$", category_videos, name="localtv_category"),
    url(
        r"^author/$",
Ejemplo n.º 2
0
from localtv.views import IndexView

# "Base" patterns
urlpatterns = patterns(
    'localtv.views',
    url(r'^$', IndexView.as_view(), name='localtv_index'),
    url(r'^about/$', 'about', name='localtv_about'),
    url(r'^share/(\d+)/(\d+)', 'share_email', name='email-share'),
    url(r'^video/(?P<video_id>[0-9]+)/(?P<slug>[\w-]*)/?$', 'view_video',
                    name='localtv_view_video'),
    url(r'^newsletter/$', 'newsletter', name='localtv_newsletter'))

# Listing patterns
category_videos = CategoryVideoSearchView.as_view(
    template_name='localtv/category.html',
    url_filter='category',
    url_filter_kwarg='slug',
    default_sort='-date'
)
urlpatterns += patterns(
    'localtv.listing.views',
    url(r'^search/$', VideoSearchView.as_view(
                        template_name='localtv/video_listing_search.html',
                    ), name='localtv_search'),
    url(r'^category/$', SiteListView.as_view(
                        template_name='localtv/categories.html',
                        queryset=Category.objects.filter(parent=None),
                        paginate_by=15
                    ), name='localtv_category_index'),
    url(r'^category/(?P<slug>[-\w]+)/$', category_videos,
                    name='localtv_category'),
    url(r'^author/$', ListView.as_view(
Ejemplo n.º 3
0
from localtv.views import IndexView

# "Base" patterns
urlpatterns = patterns(
    'localtv.views', url(r'^$', IndexView.as_view(), name='localtv_index'),
    url(r'^about/$', 'about', name='localtv_about'),
    url(r'^share/(\d+)/(\d+)', 'share_email', name='email-share'),
    url(r'^video/(?P<video_id>[0-9]+)/(?P<slug>[\w-]*)/?$',
        'view_video',
        name='localtv_view_video'),
    url(r'^newsletter/$', 'newsletter', name='localtv_newsletter'))

# Listing patterns
category_videos = CategoryVideoSearchView.as_view(
    template_name='localtv/category.html',
    url_filter='category',
    url_filter_kwarg='slug',
    default_sort='-date')
urlpatterns += patterns(
    'localtv.listing.views',
    url(r'^search/$',
        VideoSearchView.as_view(
            template_name='localtv/video_listing_search.html', ),
        name='localtv_search'),
    url(r'^category/$',
        SiteListView.as_view(template_name='localtv/categories.html',
                             queryset=Category.objects.filter(parent=None),
                             paginate_by=15),
        name='localtv_category_index'),
    url(r'^category/(?P<slug>[-\w]+)/$',
        category_videos,