mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
26 lines
426 B
Python
26 lines
426 B
Python
from django.contrib.auth.models import Group, User
|
|
|
|
from utilities.api import WritableNestedSerializer
|
|
|
|
_all_ = [
|
|
'NestedUserSerializer',
|
|
]
|
|
|
|
|
|
#
|
|
# Groups and users
|
|
#
|
|
|
|
class NestedGroupSerializer(WritableNestedSerializer):
|
|
|
|
class Meta:
|
|
model = Group
|
|
fields = ['id', 'name']
|
|
|
|
|
|
class NestedUserSerializer(WritableNestedSerializer):
|
|
|
|
class Meta:
|
|
model = User
|
|
fields = ['id', 'username']
|