source: asadb/groups/migrations/0022_add_shared_storage.py

space-accessstablestage
Last change on this file was 6c0251f, checked in by Alex Dehnert <adehnert@…>, 14 years ago

Add a "shared storage access" OfficerRole?

  • Property mode set to 100644
File size: 4.8 KB
Line 
1# encoding: utf-8
2import datetime
3from south.db import db
4from south.v2 import DataMigration
5from django.db import models
6
7
8class Migration(DataMigration):
9
10    def forwards(self, orm):
11        "Write your forwards methods here."
12        defaults = {}
13        defaults['display_name'] = 'Shared Storage Access'
14        slug = 'locker-access'
15        defaults['description'] = 'People with card access for W20-437 and W20-441 shared storage spaces for groups with locker/shelf space in those rooms.'
16        defaults['max_count'] = 6
17        defaults['require_student'] = False
18        defaults['grant_user'] = None
19        defaults['publicly_visible'] = False
20        officerrole, created = orm['groups.officerrole'].objects.get_or_create(slug=slug, defaults=defaults)
21
22
23    def backwards(self, orm):
24        "Write your backwards methods here."
25        print "Refraining from removing OfficerRole for locker-access."
26
27    models = {
28        'auth.group': {
29            'Meta': {'object_name': 'Group'},
30            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
31            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
32            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
33        },
34        'auth.permission': {
35            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
36            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
37            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
38            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
39            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
40        },
41        'auth.user': {
42            'Meta': {'object_name': 'User'},
43            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
44            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
45            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
46            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
47            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
48            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
49            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
50            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
51            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
52            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
53            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
54            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
55            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
56        },
57        'contenttypes.contenttype': {
58            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
59            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
60            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
61            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
62            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
63        },
64        'groups.officerrole': {
65            'Meta': {'object_name': 'OfficerRole'},
66            'description': ('django.db.models.fields.TextField', [], {}),
67            'display_name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
68            'grant_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
69            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
70            'max_count': ('django.db.models.fields.IntegerField', [], {'default': '10000'}),
71            'publicly_visible': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
72            'require_student': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
73            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'})
74        }
75    }
76
77    complete_apps = ['groups']
Note: See TracBrowser for help on using the repository browser.