Support Routes==2.3
SubMapper.connect allows in Routes<=2.2 to define routes with/without a name: map.connect(route_name, route_path) map.connect(route_path) Routes==2.3 SubMapper.connect now requires a route name (but not Mapper.connect). This change adds a route name when needed to support Routes<=2.2 and Routes==2.3. Closes-Bug: #1563028 Change-Id: I655bfe7f047945896d63dd94c584acfe60d81b38
This commit is contained in:
parent
54653c4e59
commit
c6efa6292c
|
@ -283,8 +283,9 @@ class ExtensionMiddleware(base.ConfigurableMiddleware):
|
|||
action=action,
|
||||
path_prefix=path_prefix,
|
||||
conditions=conditions) as submap:
|
||||
submap.connect(path)
|
||||
submap.connect("%s.:(format)" % path)
|
||||
submap.connect(path_prefix + path, path)
|
||||
submap.connect(path_prefix + path + "_format",
|
||||
"%s.:(format)" % path)
|
||||
|
||||
for action, method in resource.collection_methods.items():
|
||||
conditions = dict(method=[method])
|
||||
|
@ -293,8 +294,9 @@ class ExtensionMiddleware(base.ConfigurableMiddleware):
|
|||
action=action,
|
||||
path_prefix=path_prefix,
|
||||
conditions=conditions) as submap:
|
||||
submap.connect(path)
|
||||
submap.connect("%s.:(format)" % path)
|
||||
submap.connect(path_prefix + path, path)
|
||||
submap.connect(path_prefix + path + "_format",
|
||||
"%s.:(format)" % path)
|
||||
|
||||
mapper.resource(resource.collection, resource.collection,
|
||||
controller=resource.controller,
|
||||
|
|
Loading…
Reference in New Issue