mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
583 B
22 lines
583 B
4 years ago
|
from __future__ import unicode_literals
|
||
|
|
||
|
from django.db import models
|
||
|
from django.db.models.signals import post_save
|
||
|
from ..backends.command.models import AbstractSessionCommand
|
||
|
|
||
|
|
||
|
class CommandManager(models.Manager):
|
||
|
def bulk_create(self, objs, **kwargs):
|
||
|
resp = super().bulk_create(objs, **kwargs)
|
||
|
for i in objs:
|
||
|
post_save.send(i.__class__, instance=i, created=True)
|
||
|
return resp
|
||
|
|
||
|
|
||
|
class Command(AbstractSessionCommand):
|
||
|
objects = CommandManager()
|
||
|
|
||
|
class Meta:
|
||
|
db_table = "terminal_command"
|
||
|
ordering = ('-timestamp',)
|