Skip to content

Commit

Permalink
Support add_routes
Browse files Browse the repository at this point in the history
  • Loading branch information
aamalev authored Aug 16, 2020
1 parent 3df69b2 commit c5b9585
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions aiohttp_apiset/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,11 @@ def add_delete(self, *args, **kwargs):
Shortcut for add_route with method DELETE
"""
return self.add_route(hdrs.METH_DELETE, *args, **kwargs)

def add_routes(self, routes) -> None:
"""Append routes to route table.
Parameter should be a sequence of RouteDef objects.
"""
for route_def in routes:
route_def.register(self)

0 comments on commit c5b9585

Please sign in to comment.