2016-11-20 04:18:44 +00:00
|
|
|
# ~*~ coding: utf-8 ~*~
|
2016-11-20 08:22:41 +00:00
|
|
|
from __future__ import unicode_literals
|
2016-11-20 04:18:44 +00:00
|
|
|
|
2016-12-19 06:07:21 +00:00
|
|
|
from ops.models import *
|
2016-11-20 04:18:44 +00:00
|
|
|
from rest_framework import serializers
|
|
|
|
|
|
|
|
|
|
|
|
class HostAliaSerializer(serializers.ModelSerializer):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = HostAlia
|
|
|
|
|
|
|
|
|
|
|
|
class CmdAliaSerializer(serializers.ModelSerializer):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = CmdAlia
|
|
|
|
|
|
|
|
|
|
|
|
class UserAliaSerializer(serializers.ModelSerializer):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = UserAlia
|
|
|
|
|
|
|
|
|
|
|
|
class RunasAliaSerializer(serializers.ModelSerializer):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = RunasAlia
|
|
|
|
|
|
|
|
|
|
|
|
class ExtraconfSerializer(serializers.ModelSerializer):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = Extra_conf
|
|
|
|
|
2016-11-20 06:48:18 +00:00
|
|
|
|
|
|
|
class PrivilegeSerializer(serializers.ModelSerializer):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = Privilege
|
|
|
|
|
|
|
|
|
|
|
|
class SudoSerializer(serializers.ModelSerializer):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = Sudo
|
|
|
|
|
|
|
|
|
2016-11-22 02:41:18 +00:00
|
|
|
class CronTableSerializer(serializers.ModelSerializer):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = CronTable
|
2016-12-19 06:07:21 +00:00
|
|
|
|
|
|
|
class TaskSerializer(serializers.ModelSerializer):
|
2016-12-19 15:46:03 +00:00
|
|
|
sub_tasks = serializers.PrimaryKeyRelatedField(many=True, read_only=True)
|
2016-12-19 06:07:21 +00:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = Task
|
|
|
|
read_only_fields = ('record',)
|
2016-12-19 15:46:03 +00:00
|
|
|
|
|
|
|
class SubTaskSerializer(serializers.ModelSerializer):
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = SubTask
|