Add command list

This commit is contained in:
ibuler
2016-10-26 19:10:14 +08:00
parent c2aab50c7b
commit 5d3f9b4a03
15 changed files with 149 additions and 56 deletions

View File

@@ -2,6 +2,7 @@
#
from __future__ import unicode_literals
import base64
from django.db import models
from django.utils.translation import ugettext_lazy as _
@@ -68,6 +69,10 @@ class CommandLog(models.Model):
def __unicode__(self):
return '%s: %s' % (self.id, self.command)
@property
def output_decode(self):
return base64.b64decode(self.output).replace('\n', '<br />')
class Meta:
db_table = 'command_log'
ordering = ['command_no', 'command']