1
# -*- coding: utf-8 -*-
3
from south.db import db
4
from django.db import models
5
from swevote.models import *
9
def forwards(self, orm):
11
# Adding model 'VotingLocal'
12
db.create_table('swevote_votinglocal', (
13
('id', models.AutoField(primary_key=True)),
14
('localtype', models.IntegerField()),
15
('municipality', models.ForeignKey(orm.Municipality)),
16
('region', models.ForeignKey(orm.Region)),
17
('name', models.CharField(max_length=60)),
18
('slug', models.CharField(max_length=80)),
19
('address1', models.CharField(max_length=60)),
20
('address2', models.CharField(max_length=60)),
21
('address3', models.CharField(max_length=60)),
22
('city', models.CharField(max_length=60)),
23
('voters', models.IntegerField(default=0)),
24
('lat', models.DecimalField(max_digits=8, decimal_places=5)),
25
('lon', models.DecimalField(max_digits=8, decimal_places=5)),
27
db.send_create_signal('swevote', ['VotingLocal'])
29
# Adding model 'OpeningHours'
30
db.create_table('swevote_openinghours', (
31
('id', models.AutoField(primary_key=True)),
32
('date', models.DateField()),
33
('opens', models.TimeField()),
34
('closes', models.TimeField()),
36
db.send_create_signal('swevote', ['OpeningHours'])
38
# Adding ManyToManyField 'VotingLocal.opening_hours'
39
db.create_table('swevote_votinglocal_opening_hours', (
40
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
41
('votinglocal', models.ForeignKey(orm.VotingLocal, null=False)),
42
('openinghours', models.ForeignKey(orm.OpeningHours, null=False))
45
# Adding field 'VotingStation.votinglocal'
46
db.add_column('swevote_votingstation', 'votinglocal', models.ForeignKey(orm.VotingLocal, related_name='districts', null=True))
48
# Creating unique_together for [municipality, slug] on VotingLocal.
49
db.create_unique('swevote_votinglocal', ['municipality_id', 'slug'])
53
def backwards(self, orm):
55
# Deleting model 'VotingLocal'
56
db.delete_table('swevote_votinglocal')
58
# Deleting model 'OpeningHours'
59
db.delete_table('swevote_openinghours')
61
# Dropping ManyToManyField 'VotingLocal.opening_hours'
62
db.delete_table('swevote_votinglocal_opening_hours')
64
# Deleting field 'VotingStation.votinglocal'
65
db.delete_column('swevote_votingstation', 'votinglocal_id')
67
# Deleting unique_together for [municipality, slug] on VotingLocal.
68
db.delete_unique('swevote_votinglocal', ['municipality_id', 'slug'])
73
'swevote.openinghours': {
74
'closes': ('models.TimeField', [], {}),
75
'date': ('models.DateField', [], {}),
76
'id': ('models.AutoField', [], {'primary_key': 'True'}),
77
'opens': ('models.TimeField', [], {})
79
'swevote.earlyvotingstation': {
80
'Meta': {'ordering': "['name']"},
81
'address1': ('models.CharField', [], {'max_length': '60'}),
82
'address2': ('models.CharField', [], {'max_length': '60'}),
83
'address3': ('models.CharField', [], {'max_length': '60'}),
84
'available': ('models.CharField', [], {'max_length': '600'}),
85
'city': ('models.CharField', [], {'max_length': '60'}),
86
'code': ('models.IntegerField', [], {}),
87
'county': ('models.ForeignKey', ["orm['swevote.County']"], {}),
88
'id': ('models.AutoField', [], {'primary_key': 'True'}),
89
'lat': ('models.DecimalField', [], {'max_digits': '8', 'decimal_places': '5'}),
90
'lon': ('models.DecimalField', [], {'max_digits': '8', 'decimal_places': '5'}),
91
'municipality': ('models.ForeignKey', ["orm['swevote.Municipality']"], {}),
92
'name': ('models.CharField', [], {'max_length': '100'}),
93
'opening_hours': ('models.CharField', [], {'max_length': '600'}),
94
'region': ('models.ForeignKey', ["orm['swevote.Region']"], {}),
95
'slug': ('models.CharField', [], {'max_length': '100'}),
96
'status': ('models.CharField', [], {'max_length': '10'})
98
'swevote.municipality': {
99
'Meta': {'ordering': "['name']"},
100
'county': ('models.ForeignKey', ["orm['swevote.County']"], {}),
101
'id': ('models.AutoField', [], {'primary_key': 'True'}),
102
'name': ('models.CharField', [], {'max_length': '60'}),
103
'region': ('models.ForeignKey', ["orm['swevote.Region']"], {}),
104
'slug': ('models.CharField', [], {'max_length': '60'})
106
'swevote.votinglocal': {
107
'Meta': {'unique_together': '("municipality","slug")'},
108
'address1': ('models.CharField', [], {'max_length': '60'}),
109
'address2': ('models.CharField', [], {'max_length': '60'}),
110
'address3': ('models.CharField', [], {'max_length': '60'}),
111
'city': ('models.CharField', [], {'max_length': '60'}),
112
'id': ('models.AutoField', [], {'primary_key': 'True'}),
113
'lat': ('models.DecimalField', [], {'max_digits': '8', 'decimal_places': '5'}),
114
'localtype': ('models.IntegerField', [], {}),
115
'lon': ('models.DecimalField', [], {'max_digits': '8', 'decimal_places': '5'}),
116
'municipality': ('models.ForeignKey', ["orm['swevote.Municipality']"], {}),
117
'name': ('models.CharField', [], {'max_length': '60'}),
118
'opening_hours': ('models.ManyToManyField', ["orm['swevote.OpeningHours']"], {'null': 'True'}),
119
'region': ('models.ForeignKey', ["orm['swevote.Region']"], {}),
120
'slug': ('models.CharField', [], {'max_length': '80'}),
121
'voters': ('models.IntegerField', [], {'default': '0'})
123
'swevote.votingstation': {
124
'Meta': {'ordering': "['local']"},
125
'address1': ('models.CharField', [], {'max_length': '60'}),
126
'address2': ('models.CharField', [], {'max_length': '60'}),
127
'address3': ('models.CharField', [], {'max_length': '60'}),
128
'available': ('models.CharField', [], {'max_length': '600'}),
129
'city': ('models.CharField', [], {'max_length': '60'}),
130
'code': ('models.IntegerField', [], {}),
131
'county': ('models.ForeignKey', ["orm['swevote.County']"], {}),
132
'done': ('models.CharField', [], {'max_length': '60'}),
133
'hidden': ('models.BooleanField', [], {'default': 'False'}),
134
'id': ('models.AutoField', [], {'primary_key': 'True'}),
135
'lat': ('models.DecimalField', [], {'max_digits': '8', 'decimal_places': '5'}),
136
'local': ('models.CharField', [], {'max_length': '60'}),
137
'lon': ('models.DecimalField', [], {'max_digits': '8', 'decimal_places': '5'}),
138
'municipality': ('models.ForeignKey', ["orm['swevote.Municipality']"], {}),
139
'name': ('models.CharField', [], {'max_length': '60'}),
140
'parent': ('models.ForeignKey', ["orm['swevote.VotingStation']"], {'null': 'True'}),
141
'region': ('models.ForeignKey', ["orm['swevote.Region']"], {}),
142
'slug': ('models.CharField', [], {'max_length': '60'}),
143
'status': ('models.CharField', [], {'max_length': '10'}),
144
'voters': ('models.IntegerField', [], {'default': '0'}),
145
'votinglocal': ('models.ForeignKey', ["orm['swevote.VotingLocal']"], {'related_name': "'districts'", 'null': 'True'})
148
'Meta': {'ordering': "['city']"},
149
'city': ('models.CharField', [], {'max_length': '60'}),
150
'id': ('models.AutoField', [], {'primary_key': 'True'}),
151
'municipality': ('models.ForeignKey', ["orm['swevote.Municipality']"], {}),
152
'zipcode': ('models.CharField', [], {'max_length': '5'})
155
'id': ('models.AutoField', [], {'primary_key': 'True'}),
156
'name': ('models.CharField', [], {'max_length': '60'}),
157
'parent': ('models.ForeignKey', ["orm['swevote.Region']"], {'null': 'True'}),
158
'shortname': ('models.CharField', [], {'unique': 'True', 'max_length': '20'}),
159
'total_early_stations': ('models.IntegerField', [], {'default': '0'}),
160
'total_stations': ('models.IntegerField', [], {'default': '0'}),
161
'total_voters': ('models.IntegerField', [], {'default': '0'})
164
'Meta': {'ordering': "['name']"},
165
'id': ('models.AutoField', [], {'primary_key': 'True'}),
166
'name': ('models.CharField', [], {'max_length': '60'}),
167
'slug': ('models.CharField', [], {'max_length': '60'})
171
complete_apps = ['swevote']