PageRenderTime 228ms CodeModel.GetById 80ms app.highlight 67ms RepoModel.GetById 74ms app.codeStats 0ms

/volunteers/migrations/0001_initial.py

http://utos-conman.googlecode.com/
Python | 58 lines | 40 code | 14 blank | 4 comment | 0 complexity | 5b9851f8894bdc4a05bfd4771dc07ef5 MD5 | raw file
 1
 2from south.db import db
 3from django.db import models
 4from volunteers.models import *
 5
 6class Migration:
 7    
 8    def forwards(self, orm):
 9        
10        # Adding model 'VolunteerRole'
11        db.create_table('volunteers_volunteerrole', (
12            ('id', models.AutoField(primary_key=True)),
13            ('name', models.CharField(max_length=150, db_index=True)),
14        ))
15        db.send_create_signal('volunteers', ['VolunteerRole'])
16        
17        # Adding model 'Volunteer'
18        db.create_table('volunteers_volunteer', (
19            ('requested', models.ForeignKey(orm.VolunteerRole, related_name='requested')),
20            ('role', models.ForeignKey(orm.VolunteerRole, related_name='role', null=True, blank=True)),
21            ('id', models.AutoField(primary_key=True)),
22            ('comments', models.TextField()),
23            ('volunteer', models.ForeignKey(orm['common.UserProfile'], unique=True)),
24        ))
25        db.send_create_signal('volunteers', ['Volunteer'])
26        
27    
28    
29    def backwards(self, orm):
30        
31        # Deleting model 'VolunteerRole'
32        db.delete_table('volunteers_volunteerrole')
33        
34        # Deleting model 'Volunteer'
35        db.delete_table('volunteers_volunteer')
36        
37    
38    
39    models = {
40        'volunteers.volunteerrole': {
41            'id': ('models.AutoField', [], {'primary_key': 'True'}),
42            'name': ('models.CharField', [], {'max_length': '150', 'db_index': 'True'})
43        },
44        'common.userprofile': {
45            '_stub': True,
46            'id': ('models.AutoField', [], {'primary_key': 'True'})
47        },
48        'volunteers.volunteer': {
49            'Meta': {'permissions': '(("can_drive","Can drive"),("can_vote","Can vote in elections"),("can_drink","Can drink alcohol"),)'},
50            'comments': ('models.TextField', [], {}),
51            'id': ('models.AutoField', [], {'primary_key': 'True'}),
52            'requested': ('models.ForeignKey', ['VolunteerRole'], {'related_name': "'requested'"}),
53            'role': ('models.ForeignKey', ['VolunteerRole'], {'related_name': "'role'", 'null': 'True', 'blank': 'True'}),
54            'volunteer': ('models.ForeignKey', ['UserProfile'], {'unique': 'True'})
55        }
56    }
57    
58    complete_apps = ['volunteers']