Skip to content

Instantly share code, notes, and snippets.

@bencleary
Created December 10, 2017 21:52
Show Gist options
  • Save bencleary/6c0479fb10a71d7f1e95a52f300f5800 to your computer and use it in GitHub Desktop.
Save bencleary/6c0479fb10a71d7f1e95a52f300f5800 to your computer and use it in GitHub Desktop.
from django.contrib import admin
from .models import *
class ManagementAdmin(admin.ModelAdmin):
list_display = ['task', 'count', 'started', 'finished', 'state']
admin.site.register(ManagementLog, ManagementAdmin)
from django.db import models
class ManagementLog(models.Model):
task = models.CharField(max_length=120)
count = models.IntegerField(blank=True, null=True)
started = models.DateTimeField(blank=True, null=True)
finished = models.DateTimeField(blank=True, null=True)
state_choices = (
(1, "Starting"),
(1, "In Progress"),
(1, "Finished"),
)
state = models.IntegerField(choices=state_choices, blank=True, null=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment