You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

app.py 918B

12345678910111213141516171819202122232425
  1. from django.conf.urls.defaults import patterns, url
  2. from oscar.core.application import Application
  3. from oscar.apps.promotions.views import HomeView, RecordClickView
  4. from oscar.apps.promotions.models import PagePromotion, KeywordPromotion
  5. class PromotionsApplication(Application):
  6. name = 'promotions'
  7. home_view = HomeView
  8. record_click_view = RecordClickView
  9. def get_urls(self):
  10. urlpatterns = patterns('',
  11. url(r'page-redirect/(?P<page_promotion_id>\d+)/$',
  12. self.record_click_view.as_view(model=PagePromotion), name='page-click'),
  13. url(r'keyword-redirect/(?P<keyword_promotion_id>\d+)/$',
  14. self.record_click_view.as_view(model=KeywordPromotion), name='keyword-click'),
  15. url(r'^$', self.home_view.as_view(), name='home'),
  16. )
  17. return self.post_process_urls(urlpatterns)
  18. application = PromotionsApplication()