forked from django-oscar/django-oscar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted final two apps over to new structure
- Loading branch information
1 parent
cccce7a
commit b2c8270
Showing
9 changed files
with
84 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from django.conf.urls.defaults import patterns, url | ||
from django.contrib.admin.views.decorators import staff_member_required | ||
from haystack.query import SearchQuerySet | ||
|
||
from oscar.core.application import Application | ||
from oscar.apps.reports.views import DashboardView | ||
|
||
|
||
class ReportsApplication(Application): | ||
name = 'reports' | ||
|
||
dashboard_view = DashboardView | ||
|
||
def get_urls(self): | ||
urlpatterns = patterns('', | ||
url(r'^$', self.dashboard_view.as_view(), name='dashboard'), | ||
) | ||
return urlpatterns | ||
|
||
application = ReportsApplication() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from django.conf.urls.defaults import patterns, url | ||
from django.contrib.admin.views.decorators import staff_member_required | ||
from haystack.query import SearchQuerySet | ||
|
||
from oscar.core.application import Application | ||
from oscar.apps.search.views import SuggestionsView, MultiFacetedSearchView | ||
from oscar.apps.search.search_indexes import ProductIndex | ||
from oscar.apps.search.forms import MultiFacetedSearchForm | ||
|
||
|
||
class SearchApplication(Application): | ||
name = 'search' | ||
|
||
suggestions_view = SuggestionsView | ||
search_view = MultiFacetedSearchView | ||
|
||
def get_urls(self): | ||
sqs = SearchQuerySet() | ||
for field_name, field in ProductIndex.fields.items(): | ||
if field.faceted is True: | ||
# Ensure we facet the results set by the defined facetable fields | ||
sqs.facet(field_name) | ||
|
||
urlpatterns = patterns('', | ||
url(r'^suggest/$', self.suggestions_view.as_view(), name='suggest'), | ||
url(r'^$', self.search_view(form_class=MultiFacetedSearchForm, | ||
searchqueryset=sqs), name='search'), | ||
) | ||
return urlpatterns | ||
|
||
application = SearchApplication() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters