0001_initial.py 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.db import models, migrations
  4. import core.models
  5. class Migration(migrations.Migration):
  6. dependencies = [
  7. ]
  8. operations = [
  9. migrations.CreateModel(
  10. name='Answer',
  11. fields=[
  12. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  13. ('agreement_level', models.IntegerField(verbose_name='agreement_level')),
  14. ('note', models.TextField(verbose_name='note')),
  15. ],
  16. options={
  17. 'verbose_name': 'answer',
  18. 'verbose_name_plural': 'answers',
  19. },
  20. bases=(models.Model,),
  21. ),
  22. migrations.CreateModel(
  23. name='Category',
  24. fields=[
  25. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  26. ('name', models.CharField(max_length=50, verbose_name='name')),
  27. ('name_de', models.CharField(max_length=50, null=True, verbose_name='name')),
  28. ('name_fr', models.CharField(max_length=50, null=True, verbose_name='name')),
  29. ('name_it', models.CharField(max_length=50, null=True, verbose_name='name')),
  30. ],
  31. options={
  32. 'verbose_name': 'category',
  33. 'verbose_name_plural': 'categories',
  34. },
  35. bases=(models.Model,),
  36. ),
  37. migrations.CreateModel(
  38. name='Link',
  39. fields=[
  40. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  41. ('url', models.URLField(verbose_name='url')),
  42. ],
  43. options={
  44. },
  45. bases=(models.Model,),
  46. ),
  47. migrations.CreateModel(
  48. name='LinkType',
  49. fields=[
  50. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  51. ('icon', models.ImageField(upload_to=b'icons/', verbose_name='icon')),
  52. ('name', models.CharField(max_length=50, verbose_name='name')),
  53. ('name_de', models.CharField(max_length=50, null=True, verbose_name='name')),
  54. ('name_fr', models.CharField(max_length=50, null=True, verbose_name='name')),
  55. ('name_it', models.CharField(max_length=50, null=True, verbose_name='name')),
  56. ],
  57. options={
  58. },
  59. bases=(models.Model,),
  60. ),
  61. migrations.CreateModel(
  62. name='Party',
  63. fields=[
  64. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  65. ('name', models.CharField(max_length=50, verbose_name='name')),
  66. ('name_de', models.CharField(max_length=50, null=True, verbose_name='name')),
  67. ('name_fr', models.CharField(max_length=50, null=True, verbose_name='name')),
  68. ('name_it', models.CharField(max_length=50, null=True, verbose_name='name')),
  69. ('shortname', models.CharField(max_length=10, verbose_name='shortname')),
  70. ('shortname_de', models.CharField(max_length=10, null=True, verbose_name='shortname')),
  71. ('shortname_fr', models.CharField(max_length=10, null=True, verbose_name='shortname')),
  72. ('shortname_it', models.CharField(max_length=10, null=True, verbose_name='shortname')),
  73. ],
  74. options={
  75. 'verbose_name': 'party',
  76. 'verbose_name_plural': 'parties',
  77. },
  78. bases=(models.Model,),
  79. ),
  80. migrations.CreateModel(
  81. name='Politician',
  82. fields=[
  83. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  84. ('first_name', models.CharField(max_length=100, verbose_name='first_name')),
  85. ('last_name', models.CharField(max_length=100, verbose_name='last_name')),
  86. ('email', models.EmailField(max_length=75, verbose_name='email')),
  87. ('image', models.ImageField(upload_to=b'politicians/', null=True, verbose_name='image', blank=True)),
  88. ('is_member_of_parliament', models.BooleanField(default=False, verbose_name='is_member_of_parliament')),
  89. ('past_contributions', models.TextField(verbose_name='past_contributions', blank=True)),
  90. ('future_plans', models.TextField(verbose_name='future_plans', blank=True)),
  91. ('unique_url', models.CharField(default=core.models.generate_url, max_length=20, verbose_name='unique_url')),
  92. ('party_other', models.CharField(max_length=50, null=True, verbose_name='party_other', blank=True)),
  93. ('party', models.ForeignKey(verbose_name='party', blank=True, to='core.Party', null=True)),
  94. ],
  95. options={
  96. 'verbose_name': 'politician',
  97. 'verbose_name_plural': 'politicians',
  98. },
  99. bases=(models.Model,),
  100. ),
  101. migrations.CreateModel(
  102. name='Question',
  103. fields=[
  104. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  105. ('preferred_answer', models.IntegerField(verbose_name='preferred_answer')),
  106. ('question_number', models.IntegerField(verbose_name='question_number')),
  107. ('text', models.TextField(verbose_name='text')),
  108. ('text_de', models.TextField(null=True, verbose_name='text')),
  109. ('text_fr', models.TextField(null=True, verbose_name='text')),
  110. ('text_it', models.TextField(null=True, verbose_name='text')),
  111. ('category', models.ForeignKey(verbose_name='category', to='core.Category')),
  112. ],
  113. options={
  114. 'verbose_name': 'question',
  115. 'verbose_name_plural': 'questions',
  116. },
  117. bases=(models.Model,),
  118. ),
  119. migrations.CreateModel(
  120. name='State',
  121. fields=[
  122. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  123. ('name', models.CharField(max_length=50, verbose_name='name')),
  124. ('name_de', models.CharField(max_length=50, null=True, verbose_name='name')),
  125. ('name_fr', models.CharField(max_length=50, null=True, verbose_name='name')),
  126. ('name_it', models.CharField(max_length=50, null=True, verbose_name='name')),
  127. ],
  128. options={
  129. 'verbose_name': 'state',
  130. 'verbose_name_plural': 'states',
  131. },
  132. bases=(models.Model,),
  133. ),
  134. migrations.CreateModel(
  135. name='Statistic',
  136. fields=[
  137. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  138. ('value', models.FloatField(verbose_name='value')),
  139. ('category', models.ForeignKey(verbose_name='category', to='core.Category')),
  140. ('politician', models.ForeignKey(verbose_name='politician', to='core.Politician')),
  141. ],
  142. options={
  143. 'verbose_name': 'statistic',
  144. 'verbose_name_plural': 'statistics',
  145. },
  146. bases=(models.Model,),
  147. ),
  148. migrations.AddField(
  149. model_name='politician',
  150. name='state',
  151. field=models.ForeignKey(verbose_name='state', blank=True, to='core.State', null=True),
  152. preserve_default=True,
  153. ),
  154. migrations.AddField(
  155. model_name='link',
  156. name='politician',
  157. field=models.ForeignKey(verbose_name='politician', to='core.Politician'),
  158. preserve_default=True,
  159. ),
  160. migrations.AddField(
  161. model_name='link',
  162. name='type',
  163. field=models.ForeignKey(verbose_name='type', to='core.LinkType'),
  164. preserve_default=True,
  165. ),
  166. migrations.AddField(
  167. model_name='answer',
  168. name='politician',
  169. field=models.ForeignKey(verbose_name='politician', to='core.Politician'),
  170. preserve_default=True,
  171. ),
  172. migrations.AddField(
  173. model_name='answer',
  174. name='question',
  175. field=models.ForeignKey(verbose_name='question', to='core.Question'),
  176. preserve_default=True,
  177. ),
  178. ]