Commit c288ee7b by Sanford Student

adding model

parent 867fac31
......@@ -5,8 +5,10 @@ This will mostly involve searching by course_id or task_id and manually failing
a task.
"""
from config_models.admin import ConfigurationModelAdmin
from django.contrib import admin
from .models import InstructorTask
from .config.models import GradeReportSetting
class InstructorTaskAdmin(admin.ModelAdmin):
......@@ -34,3 +36,4 @@ class InstructorTaskAdmin(admin.ModelAdmin):
email.admin_order_field = 'requester__username'
admin.site.register(InstructorTask, InstructorTaskAdmin)
admin.site.register(GradeReportSetting, ConfigurationModelAdmin)
"""
Models for configuration of settings relevant
to instructor tasks.
"""
from config_models.models import ConfigurationModel
from django.db.models import IntegerField
class GradeReportSetting(ConfigurationModel):
"""
Sets the batch size used when running grade reports
with multiple celery workers.
"""
batch_size = IntegerField(default=100)
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('instructor_task', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='GradeReportSetting',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')),
('enabled', models.BooleanField(default=False, verbose_name='Enabled')),
('batch_size', models.IntegerField(default=100)),
('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')),
],
options={
'ordering': ('-change_date',),
'abstract': False,
},
),
]
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