Skip to content

Commit a2310db

Browse files
author
Kátia Nakamura
committed
core: add DefaultRouter
1 parent d716fff commit a2310db

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

pyconbalkan/core/api_urls.py

Whitespace-only changes.

pyconbalkan/core/routers.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from rest_framework import routers
2+
3+
4+
class DefaultRouter(routers.DefaultRouter):
5+
"""
6+
Extends `DefaultRouter` class to add a method for extending url routes from another router.
7+
"""
8+
def extend(self, router):
9+
"""
10+
Extend the routes with url routes of the passed in router.
11+
12+
Args:
13+
router: SimpleRouter instance containing route definitions.
14+
"""
15+
self.registry.extend(router.registry)

0 commit comments

Comments
 (0)