Created
December 10, 2017 21:52
-
-
Save bencleary/6c0479fb10a71d7f1e95a52f300f5800 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
from .models import * | |
class ManagementAdmin(admin.ModelAdmin): | |
list_display = ['task', 'count', 'started', 'finished', 'state'] | |
admin.site.register(ManagementLog, ManagementAdmin) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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