generated from canonical/is-charms-template-repo
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Christopher Bartz <christopher.bartz@canonical.com>
- Loading branch information
1 parent
aa58776
commit 38af805
Showing
5 changed files
with
241 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright 2024 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
"""Serializers.""" | ||
|
||
from rest_framework import serializers | ||
|
||
from .models import Domain, DomainUserPermission | ||
|
||
|
||
class DomainSerializer(serializers.ModelSerializer): | ||
"""Serializer for the Domain objects.""" | ||
|
||
class Meta: | ||
"""Serializer configuration. | ||
Attributes: | ||
model: the model to serialize. | ||
fields: fields to serialize. | ||
""" | ||
|
||
model = Domain | ||
fields = "__all__" | ||
|
||
|
||
class DomainUserPermissionSerializer(serializers.ModelSerializer): | ||
"""Serializer for the DomainUserPermission objects.""" | ||
|
||
class Meta: | ||
"""Serializer configuration. | ||
Attributes: | ||
model: the model to serialize. | ||
fields: fields to serialize. | ||
""" | ||
|
||
model = DomainUserPermission | ||
fields = "__all__" |
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
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