jumpserver/apps/assets/serializers/gathered_user.py

23 lines
638 B
Python
Raw Normal View History

2019-09-18 14:06:46 +00:00
# -*- coding: utf-8 -*-
#
from django.utils.translation import ugettext_lazy as _
2019-09-18 14:06:46 +00:00
from orgs.mixins.serializers import OrgResourceModelSerializerMixin
from ..models import GatheredUser
2019-09-18 14:06:46 +00:00
class GatheredUserSerializer(OrgResourceModelSerializerMixin):
class Meta:
model = GatheredUser
fields = [
'id', 'asset', 'hostname', 'ip', 'username',
2019-11-14 03:46:42 +00:00
'date_last_login', 'ip_last_login',
2019-09-18 14:06:46 +00:00
'present', 'date_created', 'date_updated'
]
read_only_fields = fields
2020-05-20 09:45:50 +00:00
extra_kwargs = {
'hostname': {'label': _("Hostname")},
'ip': {'label': 'IP'},
}