Created
December 11, 2017 20:28
-
-
Save bencleary/fe5e0af57d0aff6f7a709c449c338f21 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 crunchy_waffles_ops.models import * | |
from django.utils import timezone | |
class Management: | |
log = None | |
def __init__(self, title): | |
self.log = ManagementLog(task=title, count=0, started=timezone.now(), state=1) | |
self.log.save() | |
def in_progress(self): | |
self.log.state = 2 | |
self.log.save() | |
def update_count(self, x): | |
self.log.count = x | |
self.log.save() | |
def completed(self): | |
self.log.state = 3 | |
self.log.finished = timezone.now() | |
self.log.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment