-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
41 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,4 @@ def to_representation(self, instance): | |
|
||
class Meta: # noqa: D106 | ||
model = Style | ||
fields = [] | ||
fields = ['id'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# coding=utf-8 | ||
"""Context Layer Management.""" | ||
|
||
from django.urls import reverse | ||
|
||
from context_layer_management.models.layer import Layer | ||
from context_layer_management.models.style import Style | ||
|
||
|
||
def layer_style_url(obj: Layer, style: Style, request) -> str: | ||
"""Return layer style url.""" | ||
return request.build_absolute_uri('/')[:-1] + reverse( | ||
'context-layer-management-style-view-set-detail', | ||
kwargs={ | ||
'layer_id': obj.id, | ||
'id': style.id | ||
} | ||
) |