from django.http import HttpResponse
from django.conf.urls import url

from wagtail.contrib.wagtailroutablepage.models import RoutablePage


def routable_page_external_view(request, arg):
    return HttpResponse("EXTERNAL VIEW: " + arg)

class RoutablePageTest(RoutablePage):
    @property
    def subpage_urls(self):
        return (
            url(r'^$', self.main, name='main'),
            url(r'^archive/year/(\d+)/$', self.archive_by_year, name='archive_by_year'),
            url(r'^archive/author/(?P<author_slug>.+)/$', self.archive_by_author, name='archive_by_author'),
            url(r'^external/(.+)/$', routable_page_external_view, name='external_view')
        )

    def archive_by_year(self, request, year):
        return HttpResponse("ARCHIVE BY YEAR: " + str(year))

    def archive_by_author(self, request, author_slug):
        return HttpResponse("ARCHIVE BY AUTHOR: " + author_slug)

    def main(self, request):
        return HttpResponse("MAIN VIEW")

@@ -277,60 +277,22 @@
     
-@property%0A    def subpage_urls(self):%0A        return
+subpage_urls =
  (%0A 
@@ -294,28 +294,24 @@
 = (%0A        
- 
-   
 url(r'%5E$', s
@@ -313,17 +313,14 @@
 $', 
-self.
+'
 main
+'
 , na
@@ -331,36 +331,32 @@
 main'),%0A        
-    
 url(r'%5Earchive/y
@@ -365,29 +365,25 @@
 r/(%5Cd+)/$', 
-self.
+'
 archive_by_y
@@ -385,16 +385,17 @@
 _by_year
+'
 , name='
@@ -409,28 +409,24 @@
 _by_year'),%0A
-    
         url(
@@ -471,13 +471,9 @@
 $', 
-self.
+'
 arch
@@ -485,16 +485,17 @@
 y_author
+'
 , name='
@@ -511,28 +511,24 @@
 y_author'),%0A
-    
         url(
@@ -599,20 +599,16 @@
 _view')%0A
-    
     )%0A%0A 

Revert "Make subpage_urls a property on RoutablePageTest"