Commit 61581107 by David Ormsbee

Adjust types and limits for common_grading/models.py

* Reduced MAX_LENGTH to 255 for varchar fields because that's the
  largest size with which we're guaranteed to be able to make an
  index on InnoDB with UTF-8 encoded text.
* Increased ESSAY_BODY_MAX_LENGTH to 10000 in response to limits
  discussion thread.
* Changed a couple of fields to text from varchar, just in case
  we ever decide to increase the size limits on them in the future.
parent c138b04f
from django.db import models from django.db import models
MAX_LENGTH = 1028 MAX_LENGTH = 255
ESSAY_BODY_MAX_LENGTH = 8192 ESSAY_BODY_MAX_LENGTH = 10000
GRADING_TYPES = ( GRADING_TYPES = (
('PE', 'Peer Assessment'), ('PE', 'Peer Assessment'),
) )
...@@ -11,7 +11,7 @@ class Submission(models.Model): ...@@ -11,7 +11,7 @@ class Submission(models.Model):
student_id = models.CharField(max_length=MAX_LENGTH, db_index=True) student_id = models.CharField(max_length=MAX_LENGTH, db_index=True)
location_id = models.CharField(max_length=MAX_LENGTH, default="") location_id = models.CharField(max_length=MAX_LENGTH, default="")
course_id = models.CharField(max_length=MAX_LENGTH, default="") course_id = models.CharField(max_length=MAX_LENGTH, default="")
essay_body = models.CharField(max_length=ESSAY_BODY_MAX_LENGTH, default="") essay_body = models.TextField(max_length=ESSAY_BODY_MAX_LENGTH, default="")
preferred_grading = models.CharField(max_length=2, choices=GRADING_TYPES) preferred_grading = models.CharField(max_length=2, choices=GRADING_TYPES)
submitted_date = models.DateTimeField() submitted_date = models.DateTimeField()
...@@ -28,5 +28,5 @@ class Scoring(models.Model): ...@@ -28,5 +28,5 @@ class Scoring(models.Model):
class Feedback(models.Model): class Feedback(models.Model):
text = models.CharField(max_length=MAX_LENGTH, default="") text = models.TextField(max_length=MAX_LENGTH, default="")
score = models.ForeignKey(Scoring) score = models.ForeignKey(Scoring)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment