Skip to content

Instantly share code, notes, and snippets.

@bzdk
Last active August 2, 2018 02:28
Show Gist options
  • Save bzdk/e3c7fc5b6f7d7d257eafc07060dcc576 to your computer and use it in GitHub Desktop.
Save bzdk/e3c7fc5b6f7d7d257eafc07060dcc576 to your computer and use it in GitHub Desktop.
from __future__ import unicode_literals
from django_mysql.models import JSONField
import uuid
from django.db import models
from admission.models import Lesson
class LAActivity(models.Model):
lesson = models.ForeignKey(Lesson)
title = models.CharField(max_length=50)
desc = models.CharField(max_length=250, blank=True)
stu_scope = None
driveitems = models.CharField(max_length=100, help_text="MS Graph API File Item ID")
driveitems_user = models.CharField(max_length=100, help_text="MS Graph API User ID")
expires_date = models.DateTimeField()
created_at = models.DateTimeField(auto_now_add=True)
assigned_at = models.DateTimeField(null=True)
def __unicode__(self):
return self.title
class LATask(models.Model):
activity = models.ForeignKey(LAActivity)
assigned_to = None
doc_name = models.CharField(max_length=250)
doc_driveitem_id = models.CharField(max_length=50)
doc_url = models.URLField(null=True)
doc_permission = None
grading = None
created_at = models.DateTimeField(auto_now_add=True)
finished_at = models.DateTimeField(null=True, blank=True)
def __unicode__(self):
return "LA Task {0}".format(self.id)
class PAProject(models.Model):
project_name = models.CharField(max_length=50)
project_desc = models.CharField(max_length=250, blank=True)
driveitems = models.CharField(max_length=100, help_text="MS Graph API File Item ID")
driveitems_user = models.CharField(max_length=100, help_text="MS Graph API User ID")
assessor_class = models.CharField(max_length=50)
grouping_config = JSONField() # includes: assessor group/list, sample_required
expires_at = models.DateTimeField()
created_at = models.DateTimeField(auto_now_add=True)
tasks_generated = models.DateTimeField(null=True)
def __unicode__(self):
return self.project_name
class PATask(models.Model):
project = models.ForeignKey(PAProject)
task_uuid = models.UUIDField(primary_key=False, default=uuid.uuid4, editable=False)
doc_name = models.CharField(max_length=250)
doc_driveitem_id = models.CharField(max_length=50)
doc_url = models.URLField(null=True)
assessor = JSONField()
assessment_grading = JSONField()
created_at = models.DateTimeField(auto_now_add=True)
finished_at = models.DateTimeField(null=True, blank=True)
def __unicode__(self):
return "PA Task {0}".format(self.id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment