Skip to content
Snippets Groups Projects
Commit 72999e84 authored by cahrens's avatar cahrens
Browse files

Initial model.

parent 938e48e5
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CourseCreators'
db.create_table('course_creators_coursecreators', (
('username', self.gf('django.db.models.fields.CharField')(unique=True, max_length=64, primary_key=True)),
('state_changed', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('state', self.gf('django.db.models.fields.CharField')(default='u', max_length=1)),
('note', self.gf('django.db.models.fields.CharField')(max_length=512, blank=True)),
))
db.send_create_signal('course_creators', ['CourseCreators'])
def backwards(self, orm):
# Deleting model 'CourseCreators'
db.delete_table('course_creators_coursecreators')
models = {
'course_creators.coursecreators': {
'Meta': {'object_name': 'CourseCreators'},
'note': ('django.db.models.fields.CharField', [], {'max_length': '512', 'blank': 'True'}),
'state': ('django.db.models.fields.CharField', [], {'default': "'u'", 'max_length': '1'}),
'state_changed': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'primary_key': 'True'})
}
}
complete_apps = ['course_creators']
\ No newline at end of file
"""
Table for storing information about whether or not Studio users have course creation privileges.
"""
from django.db import models
class CourseCreators(models.Model):
"""
Creates the database table model.
"""
STATES = (
(u'u', u'unrequested'),
(u'p', u'pending'),
(u'g', u'granted'),
(u'd', u'denied'),
)
username = models.CharField(max_length=64, blank=False, help_text="Studio username", primary_key=True, unique=True)
state_changed = models.DateTimeField('state last updated', auto_now_add=True,
help_text='The date when state was last updated')
state = models.CharField(max_length=1, blank=False, choices=STATES, default='u',
help_text='Current course creator state')
note = models.CharField(max_length=512, blank=True, help_text='Optional notes about this user (for example, '
'why course creation access was denied)')
def __unicode__(self):
s = "%s | %s [%s] | %s" % (self.username, self.state, self.state_changed, self.note)
return s
......@@ -331,6 +331,7 @@ INSTALLED_APPS = (
# For CMS
'contentstore',
'auth',
'course_creators',
'student', # misleading name due to sharing with lms
'course_groups', # not used in cms (yet), but tests run
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment