<commit_before>"""URL routing for storybase_story app"""

#import datetime
from django.conf.urls.defaults import patterns, url
#from haystack.query import SearchQuerySet
#from haystack.views import FacetedSearchView

#from storybase_story.forms import StoryFacetedSearchForm
from storybase_story.views import (ExploreStoriesView, 
    StoryBuilderView, StoryDetailView, StoryViewerView)

#sqs = SearchQuerySet().date_facet('pub_date', 
#                                   start_date=datetime.date(2009, 1, 1),
#                                   end_date=datetime.date.today(),
#                                   gap_by='month').facet('author') \
#                      .facet('school').facet('topic')

urlpatterns = patterns('',
#    url(r'search/', FacetedSearchView(form_class=StoryFacetedSearchForm,
#                                      searchqueryset=sqs),
#        name='story_search'),
    url(r'build/$', StoryBuilderView.as_view(), name='story_builder'),
    url(r'build/story/(?P<story_id>[0-9a-f]{32,32})/$', StoryBuilderView.as_view(), name='story_builder_by_id'),
    url(r'explore/$', ExploreStoriesView.as_view(), name='explore_stories'),
    url(r'stories/(?P<story_id>[0-9a-f]{32,32})/$',
        StoryDetailView.as_view(), name='story_detail_by_id'), 
    url(r'stories/(?P<slug>[0-9a-z-]+)/$',
        StoryDetailView.as_view(), name='story_detail'), 
    url(r'stories/(?P<story_id>[0-9a-f]{32,32})/viewer/$',
        StoryViewerView.as_view(), name='story_viewer_by_id'), 
    url(r'stories/(?P<slug>[0-9a-z-]+)/viewer/$',
        StoryViewerView.as_view(), name='story_viewer'), 
)<commit_msg>Redirect from /build/story/ to /build<commit_after>"""URL routing for storybase_story app"""

#import datetime
from django.conf.urls.defaults import patterns, url
from django.views.generic import RedirectView
#from haystack.query import SearchQuerySet
#from haystack.views import FacetedSearchView

#from storybase_story.forms import StoryFacetedSearchForm
from storybase_story.views import (ExploreStoriesView, 
    StoryBuilderView, StoryDetailView, StoryViewerView)

# Use reverse_lazy from Django 1.4 if it's available, otherwise
# define our own
try:
    from django.core.urlresolvers import reverse_lazy
except ImportError:
    from django.core.urlresolvers import reverse
    from django.utils.functional import lazy
    reverse_lazy = lazy(reverse, str)

#sqs = SearchQuerySet().date_facet('pub_date', 
#                                   start_date=datetime.date(2009, 1, 1),
#                                   end_date=datetime.date.today(),
#                                   gap_by='month').facet('author') \
#                      .facet('school').facet('topic')

urlpatterns = patterns('',
#    url(r'search/', FacetedSearchView(form_class=StoryFacetedSearchForm,
#                                      searchqueryset=sqs),
#        name='story_search'),
    url(r'build/$', StoryBuilderView.as_view(), name='story_builder'),
    url(r'build/story/$',
        RedirectView.as_view(url=reverse_lazy('story_builder'))),
    url(r'build/story/(?P<story_id>[0-9a-f]{32,32})/$', StoryBuilderView.as_view(), name='story_builder_by_id'),
    url(r'explore/$', ExploreStoriesView.as_view(), name='explore_stories'),
    url(r'stories/(?P<story_id>[0-9a-f]{32,32})/$',
        StoryDetailView.as_view(), name='story_detail_by_id'), 
    url(r'stories/(?P<slug>[0-9a-z-]+)/$',
        StoryDetailView.as_view(), name='story_detail'), 
    url(r'stories/(?P<story_id>[0-9a-f]{32,32})/viewer/$',
        StoryViewerView.as_view(), name='story_viewer_by_id'), 
    url(r'stories/(?P<slug>[0-9a-z-]+)/viewer/$',
        StoryViewerView.as_view(), name='story_viewer'), 
)
{'fraction_non_alphanumeric': 0.15605526957464103, 'fraction_numerical': 0.01571389867244649, 'mean_word_length': 3.453558504221954, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '214606', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1217, 'n_words': 172}