comparison piecrust/generation/base.py @ 723:606f6d57b5df

routing: Cleanup URL routing and improve page matching. * Add new types of route parameters for integers (int4, int2, int). * Remove hard-coded hacks around converting year/month/day values. * Make the blog post routes use the new typed parameters. * Fix problems with matching routes with integer parameters when they can get confused with a sub-page number.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 29 May 2016 20:19:28 -0700
parents ab5c6a8ae90a
children 661f7ba15762
comparison
equal deleted inserted replaced
722:f0a3af3fbea2 723:606f6d57b5df
127 if src.name == self.source_name: 127 if src.name == self.source_name:
128 return src 128 return src
129 raise Exception("Can't find source '%s' for generator '%s'." % ( 129 raise Exception("Can't find source '%s' for generator '%s'." % (
130 self.source_name, self.name)) 130 self.source_name, self.name))
131 131
132 def getPageFactory(self, route_metadata):
133 # This will raise `PageNotFoundError` naturally if not found.
134 return self.page_ref.getFactory()
135
132 def bake(self, ctx): 136 def bake(self, ctx):
133 raise NotImplementedError() 137 raise NotImplementedError()
134 138
135 def onRouteFunctionUsed(self, route, route_metadata): 139 def onRouteFunctionUsed(self, route, route_metadata):
136 pass 140 pass