diff --git a/orchestra/contrib/accounts/migrations/0001_initial.py b/orchestra/contrib/accounts/migrations/0001_initial.py index b298cec2..241206b2 100644 --- a/orchestra/contrib/accounts/migrations/0001_initial.py +++ b/orchestra/contrib/accounts/migrations/0001_initial.py @@ -2,35 +2,37 @@ from __future__ import unicode_literals from django.db import models, migrations -import django.contrib.auth.models import django.core.validators import django.utils.timezone +import django.contrib.auth.models class Migration(migrations.Migration): -# dependencies = [ -# ('systemusers', '0001_initial'), -# ] + dependencies = [ + ('auth', '__first__'), + ('contenttypes', '__first__'), + ('systemusers', '0001_initial'), + ] operations = [ migrations.CreateModel( name='Account', fields=[ ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)), - ('password', models.CharField(max_length=128, verbose_name='password')), - ('last_login', models.DateTimeField(verbose_name='last login', null=True, blank=True)), - ('username', models.CharField(max_length=32, verbose_name='username', help_text='Required. 64 characters or fewer. Letters, digits and ./-/_ only.', unique=True, validators=[django.core.validators.RegexValidator('^[\\w.-]+$', 'Enter a valid username.', 'invalid')])), - ('short_name', models.CharField(max_length=64, verbose_name='short name', blank=True)), - ('full_name', models.CharField(max_length=256, verbose_name='full name')), - ('email', models.EmailField(max_length=254, verbose_name='email address', help_text='Used for password recovery')), - ('type', models.CharField(max_length=32, verbose_name='type', choices=[('INDIVIDUAL', 'Individual'), ('ASSOCIATION', 'Association'), ('CUSTOMER', 'Customer'), ('STAFF', 'Staff'), ('FRIEND', 'Friend')], default='INDIVIDUAL')), - ('language', models.CharField(max_length=2, verbose_name='language', choices=[('CA', 'Catalan'), ('ES', 'Spanish'), ('EN', 'English')], default='CA')), - ('comments', models.TextField(max_length=256, verbose_name='comments', blank=True)), - ('is_superuser', models.BooleanField(verbose_name='superuser status', help_text='Designates that this user has all permissions without explicitly assigning them.', default=False)), - ('is_active', models.BooleanField(verbose_name='active', help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.', default=True)), + ('password', models.CharField(verbose_name='password', max_length=128)), + ('last_login', models.DateTimeField(blank=True, verbose_name='last login', null=True)), + ('username', models.CharField(help_text='Required. 64 characters or fewer. Letters, digits and ./-/_ only.', unique=True, validators=[django.core.validators.RegexValidator('^[\\w.-]+$', 'Enter a valid username.', 'invalid')], max_length=32, verbose_name='username')), + ('short_name', models.CharField(blank=True, verbose_name='short name', max_length=64)), + ('full_name', models.CharField(verbose_name='full name', max_length=256)), + ('email', models.EmailField(help_text='Used for password recovery', max_length=254, verbose_name='email address')), + ('type', models.CharField(verbose_name='type', choices=[('INDIVIDUAL', 'Individual'), ('ASSOCIATION', 'Association'), ('CUSTOMER', 'Customer'), ('COMPANY', 'Company'), ('PUBLICBODY', 'Public body'), ('STAFF', 'Staff'), ('FRIEND', 'Friend')], max_length=32, default='INDIVIDUAL')), + ('language', models.CharField(verbose_name='language', choices=[('EN', 'English')], max_length=2, default='EN')), + ('comments', models.TextField(blank=True, verbose_name='comments', max_length=256)), + ('is_superuser', models.BooleanField(help_text='Designates that this user has all permissions without explicitly assigning them.', default=False, verbose_name='superuser status')), + ('is_active', models.BooleanField(help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.', default=True, verbose_name='active')), ('date_joined', models.DateTimeField(verbose_name='date joined', default=django.utils.timezone.now)), -# ('main_systemuser', models.ForeignKey(null=True, editable=False, related_name='accounts_main', to='systemusers.SystemUser')), + ('main_systemuser', models.ForeignKey(to='systemusers.SystemUser', editable=False, null=True, related_name='accounts_main')), ], options={ 'abstract': False, diff --git a/orchestra/contrib/accounts/migrations/0002_auto_20150429_1351.py b/orchestra/contrib/accounts/migrations/0002_auto_20150429_1351.py deleted file mode 100644 index 35bef4c0..00000000 --- a/orchestra/contrib/accounts/migrations/0002_auto_20150429_1351.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import django.contrib.auth.models -import django.core.validators -import django.utils.timezone - -class Migration(migrations.Migration): - - dependencies = [ - ('accounts', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Account', - fields=[ - ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)), - ('password', models.CharField(max_length=128, verbose_name='password')), - ('last_login', models.DateTimeField(verbose_name='last login', null=True, blank=True)), - ('username', models.CharField(max_length=32, verbose_name='username', help_text='Required. 64 characters or fewer. Letters, digits and ./-/_ only.', unique=True, validators=[django.core.validators.RegexValidator('^[\\w.-]+$', 'Enter a valid username.', 'invalid')])), - ('short_name', models.CharField(max_length=64, verbose_name='short name', blank=True)), - ('full_name', models.CharField(max_length=256, verbose_name='full name')), - ('email', models.EmailField(max_length=254, verbose_name='email address', help_text='Used for password recovery')), - ('type', models.CharField(max_length=32, verbose_name='type', choices=[('INDIVIDUAL', 'Individual'), ('ASSOCIATION', 'Association'), ('CUSTOMER', 'Customer'), ('STAFF', 'Staff'), ('FRIEND', 'Friend')], default='INDIVIDUAL')), - ('language', models.CharField(max_length=2, verbose_name='language', choices=[('CA', 'Catalan'), ('ES', 'Spanish'), ('EN', 'English')], default='CA')), - ('comments', models.TextField(max_length=256, verbose_name='comments', blank=True)), - ('is_superuser', models.BooleanField(verbose_name='superuser status', help_text='Designates that this user has all permissions without explicitly assigning them.', default=False)), - ('is_active', models.BooleanField(verbose_name='active', help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.', default=True)), - ('date_joined', models.DateTimeField(verbose_name='date joined', default=django.utils.timezone.now)), - ('main_systemuser', models.ForeignKey(null=True, editable=False, related_name='accounts_main', to='systemusers.SystemUser')), - ], - options={ - 'abstract': False, - }, - managers=[ - ('objects', django.contrib.auth.models.UserManager()), - ], - ), - ] diff --git a/orchestra/contrib/bills/migrations/0001_initial.py b/orchestra/contrib/bills/migrations/0001_initial.py index 8ca7a6fd..a572887e 100644 --- a/orchestra/contrib/bills/migrations/0001_initial.py +++ b/orchestra/contrib/bills/migrations/0001_initial.py @@ -18,16 +18,16 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Bill', fields=[ - ('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)), - ('number', models.CharField(max_length=16, verbose_name='number', blank=True, unique=True)), + ('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)), + ('number', models.CharField(unique=True, verbose_name='number', blank=True, max_length=16)), ('type', models.CharField(verbose_name='type', choices=[('INVOICE', 'Invoice'), ('AMENDMENTINVOICE', 'Amendment invoice'), ('FEE', 'Fee'), ('AMENDMENTFEE', 'Amendment Fee'), ('PROFORMA', 'Pro forma')], max_length=16)), ('created_on', models.DateField(auto_now_add=True, verbose_name='created on')), - ('closed_on', models.DateField(null=True, verbose_name='closed on', blank=True)), - ('is_open', models.BooleanField(verbose_name='open', default=True)), - ('is_sent', models.BooleanField(verbose_name='sent', default=False)), - ('due_on', models.DateField(null=True, verbose_name='due on', blank=True)), + ('closed_on', models.DateField(verbose_name='closed on', null=True, blank=True)), + ('is_open', models.BooleanField(default=True, verbose_name='open')), + ('is_sent', models.BooleanField(default=False, verbose_name='sent')), + ('due_on', models.DateField(verbose_name='due on', null=True, blank=True)), ('updated_on', models.DateField(verbose_name='updated on', auto_now=True)), - ('total', models.DecimalField(decimal_places=2, default=0, max_digits=12)), + ('total', models.DecimalField(default=0, decimal_places=2, max_digits=12)), ('comments', models.TextField(verbose_name='comments', blank=True)), ('html', models.TextField(verbose_name='HTML', blank=True)), ('account', models.ForeignKey(related_name='bill', to=settings.AUTH_USER_MODEL, verbose_name='account')), @@ -39,12 +39,12 @@ class Migration(migrations.Migration): migrations.CreateModel( name='BillContact', fields=[ - ('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)), - ('name', models.CharField(verbose_name='name', help_text='Account full name will be used when left blank.', blank=True, max_length=256)), + ('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)), + ('name', models.CharField(verbose_name='name', blank=True, max_length=256, help_text='Account full name will be used when left blank.')), ('address', models.TextField(verbose_name='address')), - ('city', models.CharField(verbose_name='city', default='Barcelona', max_length=128)), - ('zipcode', models.CharField(verbose_name='zip code', max_length=10, validators=[django.core.validators.RegexValidator('^[0-9A-Z]{3,10}$', 'Enter a valid zipcode.')])), - ('country', models.CharField(verbose_name='country', default='ES', choices=[('BZ', 'Belize'), ('MZ', 'Mozambique'), ('ER', 'Eritrea'), ('AL', 'Albania'), ('CU', 'Cuba'), ('AM', 'Armenia'), ('ZW', 'Zimbabwe'), ('RU', 'Russian Federation'), ('PR', 'Puerto Rico'), ('MM', 'Myanmar'), ('UG', 'Uganda'), ('IQ', 'Iraq'), ('RS', 'Serbia'), ('KM', 'Comoros'), ('MY', 'Malaysia'), ('PH', 'Philippines'), ('TJ', 'Tajikistan'), ('GA', 'Gabon'), ('CL', 'Chile'), ('AG', 'Antigua and Barbuda'), ('DM', 'Dominica'), ('TC', 'Turks and Caicos Islands'), ('KI', 'Kiribati'), ('KZ', 'Kazakhstan'), ('ME', 'Montenegro'), ('BD', 'Bangladesh'), ('KW', 'Kuwait'), ('LI', 'Liechtenstein'), ('PS', 'Palestine, State of'), ('BI', 'Burundi'), ('TR', 'Turkey'), ('GF', 'French Guiana'), ('CD', 'Congo (the Democratic Republic of the)'), ('AU', 'Australia'), ('BR', 'Brazil'), ('SH', 'Saint Helena, Ascension and Tristan da Cunha'), ('PM', 'Saint Pierre and Miquelon'), ('NG', 'Nigeria'), ('TL', 'Timor-Leste'), ('LR', 'Liberia'), ('AF', 'Afghanistan'), ('HM', 'Heard Island and McDonald Islands'), ('SI', 'Slovenia'), ('MP', 'Northern Mariana Islands'), ('SN', 'Senegal'), ('PF', 'French Polynesia'), ('NZ', 'New Zealand'), ('TD', 'Chad'), ('PW', 'Palau'), ('FJ', 'Fiji'), ('PE', 'Peru'), ('CR', 'Costa Rica'), ('GD', 'Grenada'), ('CZ', 'Czech Republic'), ('YT', 'Mayotte'), ('AW', 'Aruba'), ('SK', 'Slovakia'), ('YE', 'Yemen'), ('BW', 'Botswana'), ('MK', 'Macedonia (the former Yugoslav Republic of)'), ('KR', 'Korea (the Republic of)'), ('VU', 'Vanuatu'), ('BV', 'Bouvet Island'), ('CM', 'Cameroon'), ('ZM', 'Zambia'), ('LB', 'Lebanon'), ('SE', 'Sweden'), ('NE', 'Niger'), ('CG', 'Congo'), ('IN', 'India'), ('IL', 'Israel'), ('TT', 'Trinidad and Tobago'), ('EE', 'Estonia'), ('MX', 'Mexico'), ('TW', 'Taiwan (Province of China)'), ('AI', 'Anguilla'), ('OM', 'Oman'), ('ML', 'Mali'), ('NP', 'Nepal'), ('VE', 'Venezuela (Bolivarian Republic of)'), ('BJ', 'Benin'), ('MT', 'Malta'), ('AZ', 'Azerbaijan'), ('UA', 'Ukraine'), ('JO', 'Jordan'), ('TZ', 'Tanzania, United Republic of'), ('AX', 'Åland Islands'), ('PT', 'Portugal'), ('NU', 'Niue'), ('VG', 'Virgin Islands (British)'), ('TH', 'Thailand'), ('CY', 'Cyprus'), ('AR', 'Argentina'), ('CO', 'Colombia'), ('IE', 'Ireland'), ('LA', "Lao People's Democratic Republic"), ('MS', 'Montserrat'), ('AD', 'Andorra'), ('SC', 'Seychelles'), ('PN', 'Pitcairn'), ('TN', 'Tunisia'), ('GI', 'Gibraltar'), ('GU', 'Guam'), ('SB', 'Solomon Islands'), ('MC', 'Monaco'), ('CN', 'China'), ('ZA', 'South Africa'), ('KE', 'Kenya'), ('IT', 'Italy'), ('HR', 'Croatia'), ('GY', 'Guyana'), ('BG', 'Bulgaria'), ('HU', 'Hungary'), ('CC', 'Cocos (Keeling) Islands'), ('MR', 'Mauritania'), ('SY', 'Syrian Arab Republic'), ('CF', 'Central African Republic'), ('KN', 'Saint Kitts and Nevis'), ('SX', 'Sint Maarten (Dutch part)'), ('SJ', 'Svalbard and Jan Mayen'), ('GH', 'Ghana'), ('VI', 'Virgin Islands (U.S.)'), ('HN', 'Honduras'), ('KG', 'Kyrgyzstan'), ('GQ', 'Equatorial Guinea'), ('IS', 'Iceland'), ('JP', 'Japan'), ('BL', 'Saint Barthélemy'), ('GB', 'United Kingdom of Great Britain and Northern Ireland'), ('TF', 'French Southern Territories'), ('IO', 'British Indian Ocean Territory'), ('PY', 'Paraguay'), ('RE', 'Réunion'), ('GG', 'Guernsey'), ('RW', 'Rwanda'), ('FI', 'Finland'), ('CA', 'Canada'), ('IM', 'Isle of Man'), ('ES', 'Spain'), ('HT', 'Haiti'), ('VN', 'Viet Nam'), ('WF', 'Wallis and Futuna'), ('GL', 'Greenland'), ('GP', 'Guadeloupe'), ('EG', 'Egypt'), ('BA', 'Bosnia and Herzegovina'), ('IR', 'Iran (Islamic Republic of)'), ('HK', 'Hong Kong'), ('TG', 'Togo'), ('PG', 'Papua New Guinea'), ('SS', 'South Sudan'), ('AS', 'American Samoa'), ('LC', 'Saint Lucia'), ('LU', 'Luxembourg'), ('SO', 'Somalia'), ('JE', 'Jersey'), ('GR', 'Greece'), ('EH', 'Western Sahara'), ('MU', 'Mauritius'), ('CI', "Côte d'Ivoire"), ('BH', 'Bahrain'), ('BF', 'Burkina Faso'), ('TM', 'Turkmenistan'), ('PK', 'Pakistan'), ('KY', 'Cayman Islands'), ('GE', 'Georgia'), ('VC', 'Saint Vincent and the Grenadines'), ('FR', 'France'), ('AQ', 'Antarctica'), ('LT', 'Lithuania'), ('BY', 'Belarus'), ('DK', 'Denmark'), ('RO', 'Romania'), ('GT', 'Guatemala'), ('SM', 'San Marino'), ('CW', 'Curaçao'), ('MO', 'Macao'), ('MV', 'Maldives'), ('DE', 'Germany'), ('UZ', 'Uzbekistan'), ('TK', 'Tokelau'), ('FO', 'Faroe Islands'), ('NI', 'Nicaragua'), ('MF', 'Saint Martin (French part)'), ('UM', 'United States Minor Outlying Islands'), ('LK', 'Sri Lanka'), ('NL', 'Netherlands'), ('NR', 'Nauru'), ('BO', 'Bolivia (Plurinational State of)'), ('GN', 'Guinea'), ('AE', 'United Arab Emirates'), ('BE', 'Belgium'), ('NA', 'Namibia'), ('BN', 'Brunei Darussalam'), ('MW', 'Malawi'), ('BQ', 'Bonaire, Sint Eustatius and Saba'), ('ET', 'Ethiopia'), ('CK', 'Cook Islands'), ('BT', 'Bhutan'), ('DO', 'Dominican Republic'), ('DZ', 'Algeria'), ('MQ', 'Martinique'), ('DJ', 'Djibouti'), ('ST', 'Sao Tome and Principe'), ('KH', 'Cambodia'), ('CX', 'Christmas Island'), ('CV', 'Cabo Verde'), ('QA', 'Qatar'), ('GS', 'South Georgia and the South Sandwich Islands'), ('FK', 'Falkland Islands [Malvinas]'), ('BS', 'Bahamas'), ('GW', 'Guinea-Bissau'), ('MA', 'Morocco'), ('PL', 'Poland'), ('ID', 'Indonesia'), ('GM', 'Gambia'), ('US', 'United States of America'), ('MN', 'Mongolia'), ('CH', 'Switzerland'), ('MH', 'Marshall Islands'), ('SR', 'Suriname'), ('EC', 'Ecuador'), ('SA', 'Saudi Arabia'), ('JM', 'Jamaica'), ('MG', 'Madagascar'), ('FM', 'Micronesia (Federated States of)'), ('AO', 'Angola'), ('SL', 'Sierra Leone'), ('KP', "Korea (the Democratic People's Republic of)"), ('BB', 'Barbados'), ('NC', 'New Caledonia'), ('TV', 'Tuvalu'), ('BM', 'Bermuda'), ('LS', 'Lesotho'), ('AT', 'Austria'), ('UY', 'Uruguay'), ('SG', 'Singapore'), ('TO', 'Tonga'), ('NF', 'Norfolk Island'), ('MD', 'Moldova (the Republic of)'), ('SZ', 'Swaziland'), ('WS', 'Samoa'), ('PA', 'Panama'), ('SD', 'Sudan'), ('NO', 'Norway'), ('LY', 'Libya'), ('LV', 'Latvia'), ('VA', 'Holy See'), ('SV', 'El Salvador')], max_length=20)), + ('city', models.CharField(default='Barcelona', verbose_name='city', max_length=128)), + ('zipcode', models.CharField(verbose_name='zip code', validators=[django.core.validators.RegexValidator('^[0-9A-Z]{3,10}$', 'Enter a valid zipcode.')], max_length=10)), + ('country', models.CharField(default='ES', verbose_name='country', choices=[('PR', 'Puerto Rico'), ('BV', 'Bouvet Island'), ('BT', 'Bhutan'), ('MY', 'Malaysia'), ('AQ', 'Antarctica'), ('MT', 'Malta'), ('BE', 'Belgium'), ('SM', 'San Marino'), ('AZ', 'Azerbaijan'), ('CA', 'Canada'), ('HR', 'Croatia'), ('GH', 'Ghana'), ('MZ', 'Mozambique'), ('PA', 'Panama'), ('GR', 'Greece'), ('AE', 'United Arab Emirates'), ('CK', 'Cook Islands'), ('SK', 'Slovakia'), ('PN', 'Pitcairn'), ('ZA', 'South Africa'), ('AU', 'Australia'), ('BF', 'Burkina Faso'), ('FI', 'Finland'), ('MC', 'Monaco'), ('RE', 'Réunion'), ('TV', 'Tuvalu'), ('HN', 'Honduras'), ('IL', 'Israel'), ('SV', 'El Salvador'), ('VN', 'Viet Nam'), ('MV', 'Maldives'), ('BA', 'Bosnia and Herzegovina'), ('UA', 'Ukraine'), ('BW', 'Botswana'), ('UZ', 'Uzbekistan'), ('ID', 'Indonesia'), ('LY', 'Libya'), ('MM', 'Myanmar'), ('TZ', 'Tanzania, United Republic of'), ('GL', 'Greenland'), ('LV', 'Latvia'), ('DZ', 'Algeria'), ('AO', 'Angola'), ('GE', 'Georgia'), ('SO', 'Somalia'), ('CX', 'Christmas Island'), ('NP', 'Nepal'), ('AI', 'Anguilla'), ('GP', 'Guadeloupe'), ('UY', 'Uruguay'), ('LC', 'Saint Lucia'), ('EH', 'Western Sahara'), ('IO', 'British Indian Ocean Territory'), ('TH', 'Thailand'), ('AR', 'Argentina'), ('PY', 'Paraguay'), ('AW', 'Aruba'), ('IE', 'Ireland'), ('CF', 'Central African Republic'), ('TW', 'Taiwan (Province of China)'), ('KZ', 'Kazakhstan'), ('TJ', 'Tajikistan'), ('RW', 'Rwanda'), ('SR', 'Suriname'), ('AT', 'Austria'), ('GN', 'Guinea'), ('SS', 'South Sudan'), ('IT', 'Italy'), ('BO', 'Bolivia (Plurinational State of)'), ('GD', 'Grenada'), ('KE', 'Kenya'), ('GS', 'South Georgia and the South Sandwich Islands'), ('TG', 'Togo'), ('CY', 'Cyprus'), ('TT', 'Trinidad and Tobago'), ('CM', 'Cameroon'), ('QA', 'Qatar'), ('GM', 'Gambia'), ('WS', 'Samoa'), ('DJ', 'Djibouti'), ('PL', 'Poland'), ('CV', 'Cabo Verde'), ('PE', 'Peru'), ('TN', 'Tunisia'), ('HT', 'Haiti'), ('AF', 'Afghanistan'), ('YT', 'Mayotte'), ('NR', 'Nauru'), ('LS', 'Lesotho'), ('LR', 'Liberia'), ('IR', 'Iran (Islamic Republic of)'), ('EE', 'Estonia'), ('ER', 'Eritrea'), ('RU', 'Russian Federation'), ('LB', 'Lebanon'), ('CU', 'Cuba'), ('CZ', 'Czech Republic'), ('AX', 'Åland Islands'), ('CD', 'Congo (the Democratic Republic of the)'), ('HK', 'Hong Kong'), ('PS', 'Palestine, State of'), ('FK', 'Falkland Islands [Malvinas]'), ('MR', 'Mauritania'), ('MG', 'Madagascar'), ('MH', 'Marshall Islands'), ('LK', 'Sri Lanka'), ('NA', 'Namibia'), ('SI', 'Slovenia'), ('BY', 'Belarus'), ('MX', 'Mexico'), ('ZW', 'Zimbabwe'), ('CI', "Côte d'Ivoire"), ('GU', 'Guam'), ('PW', 'Palau'), ('SC', 'Seychelles'), ('GT', 'Guatemala'), ('CL', 'Chile'), ('SH', 'Saint Helena, Ascension and Tristan da Cunha'), ('BH', 'Bahrain'), ('SB', 'Solomon Islands'), ('KM', 'Comoros'), ('MF', 'Saint Martin (French part)'), ('FO', 'Faroe Islands'), ('BD', 'Bangladesh'), ('AM', 'Armenia'), ('BJ', 'Benin'), ('SA', 'Saudi Arabia'), ('NU', 'Niue'), ('VI', 'Virgin Islands (U.S.)'), ('CN', 'China'), ('EC', 'Ecuador'), ('CC', 'Cocos (Keeling) Islands'), ('BS', 'Bahamas'), ('JM', 'Jamaica'), ('RO', 'Romania'), ('KI', 'Kiribati'), ('GY', 'Guyana'), ('TL', 'Timor-Leste'), ('AS', 'American Samoa'), ('VE', 'Venezuela (Bolivarian Republic of)'), ('BN', 'Brunei Darussalam'), ('ET', 'Ethiopia'), ('FJ', 'Fiji'), ('BG', 'Bulgaria'), ('VG', 'Virgin Islands (British)'), ('AD', 'Andorra'), ('KN', 'Saint Kitts and Nevis'), ('MA', 'Morocco'), ('MU', 'Mauritius'), ('DK', 'Denmark'), ('TO', 'Tonga'), ('CO', 'Colombia'), ('GA', 'Gabon'), ('MK', 'Macedonia (the former Yugoslav Republic of)'), ('MD', 'Moldova (the Republic of)'), ('VA', 'Holy See'), ('KY', 'Cayman Islands'), ('LU', 'Luxembourg'), ('AL', 'Albania'), ('LI', 'Liechtenstein'), ('KP', "Korea (the Democratic People's Republic of)"), ('BZ', 'Belize'), ('ME', 'Montenegro'), ('NC', 'New Caledonia'), ('VC', 'Saint Vincent and the Grenadines'), ('UM', 'United States Minor Outlying Islands'), ('IQ', 'Iraq'), ('GB', 'United Kingdom of Great Britain and Northern Ireland'), ('KW', 'Kuwait'), ('MS', 'Montserrat'), ('SD', 'Sudan'), ('JP', 'Japan'), ('DE', 'Germany'), ('SN', 'Senegal'), ('PK', 'Pakistan'), ('MO', 'Macao'), ('RS', 'Serbia'), ('KR', 'Korea (the Republic of)'), ('BL', 'Saint Barthélemy'), ('MP', 'Northern Mariana Islands'), ('AG', 'Antigua and Barbuda'), ('FM', 'Micronesia (Federated States of)'), ('HM', 'Heard Island and McDonald Islands'), ('BR', 'Brazil'), ('PF', 'French Polynesia'), ('MQ', 'Martinique'), ('VU', 'Vanuatu'), ('LT', 'Lithuania'), ('ES', 'Spain'), ('ML', 'Mali'), ('NE', 'Niger'), ('EG', 'Egypt'), ('WF', 'Wallis and Futuna'), ('ZM', 'Zambia'), ('US', 'United States of America'), ('DO', 'Dominican Republic'), ('NO', 'Norway'), ('UG', 'Uganda'), ('GQ', 'Equatorial Guinea'), ('GW', 'Guinea-Bissau'), ('JE', 'Jersey'), ('HU', 'Hungary'), ('BQ', 'Bonaire, Sint Eustatius and Saba'), ('JO', 'Jordan'), ('ST', 'Sao Tome and Principe'), ('SJ', 'Svalbard and Jan Mayen'), ('MN', 'Mongolia'), ('BB', 'Barbados'), ('CH', 'Switzerland'), ('KG', 'Kyrgyzstan'), ('PG', 'Papua New Guinea'), ('NG', 'Nigeria'), ('GF', 'French Guiana'), ('CR', 'Costa Rica'), ('LA', "Lao People's Democratic Republic"), ('CG', 'Congo'), ('NI', 'Nicaragua'), ('TK', 'Tokelau'), ('SE', 'Sweden'), ('NF', 'Norfolk Island'), ('PT', 'Portugal'), ('FR', 'France'), ('SZ', 'Swaziland'), ('YE', 'Yemen'), ('NL', 'Netherlands'), ('GI', 'Gibraltar'), ('TR', 'Turkey'), ('OM', 'Oman'), ('TF', 'French Southern Territories'), ('PM', 'Saint Pierre and Miquelon'), ('TC', 'Turks and Caicos Islands'), ('SL', 'Sierra Leone'), ('SX', 'Sint Maarten (Dutch part)'), ('DM', 'Dominica'), ('KH', 'Cambodia'), ('SG', 'Singapore'), ('BM', 'Bermuda'), ('CW', 'Curaçao'), ('GG', 'Guernsey'), ('TD', 'Chad'), ('IN', 'India'), ('BI', 'Burundi'), ('TM', 'Turkmenistan'), ('IS', 'Iceland'), ('MW', 'Malawi'), ('SY', 'Syrian Arab Republic'), ('NZ', 'New Zealand'), ('IM', 'Isle of Man'), ('PH', 'Philippines')], max_length=20)), ('vat', models.CharField(verbose_name='VAT number', max_length=64)), ('account', models.OneToOneField(related_name='billcontact', to=settings.AUTH_USER_MODEL, verbose_name='account')), ], @@ -52,30 +52,30 @@ class Migration(migrations.Migration): migrations.CreateModel( name='BillLine', fields=[ - ('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)), + ('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)), ('description', models.CharField(verbose_name='description', max_length=256)), - ('rate', models.DecimalField(null=True, verbose_name='rate', decimal_places=2, blank=True, max_digits=12)), + ('rate', models.DecimalField(decimal_places=2, verbose_name='rate', null=True, blank=True, max_digits=12)), ('quantity', models.DecimalField(verbose_name='quantity', decimal_places=2, max_digits=12)), ('verbose_quantity', models.CharField(verbose_name='Verbose quantity', max_length=16)), ('subtotal', models.DecimalField(verbose_name='subtotal', decimal_places=2, max_digits=12)), ('tax', models.DecimalField(verbose_name='tax', decimal_places=2, max_digits=4)), ('start_on', models.DateField(verbose_name='start')), - ('end_on', models.DateField(null=True, verbose_name='end')), - ('order_billed_on', models.DateField(null=True, verbose_name='order billed', blank=True)), - ('order_billed_until', models.DateField(null=True, verbose_name='order billed until', blank=True)), + ('end_on', models.DateField(verbose_name='end', null=True)), + ('order_billed_on', models.DateField(verbose_name='order billed', null=True, blank=True)), + ('order_billed_until', models.DateField(verbose_name='order billed until', null=True, blank=True)), ('created_on', models.DateField(auto_now_add=True, verbose_name='created')), - ('amended_line', models.ForeignKey(related_name='amendment_lines', blank=True, to='bills.BillLine', null=True, verbose_name='amended line')), + ('amended_line', models.ForeignKey(blank=True, to='bills.BillLine', verbose_name='amended line', null=True, related_name='amendment_lines')), ('bill', models.ForeignKey(related_name='lines', to='bills.Bill', verbose_name='bill')), - ('order', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.SET_NULL, null=True, to='orders.Order', help_text='Informative link back to the order')), + ('order', models.ForeignKey(blank=True, to='orders.Order', null=True, on_delete=django.db.models.deletion.SET_NULL, help_text='Informative link back to the order')), ], ), migrations.CreateModel( name='BillSubline', fields=[ - ('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)), + ('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)), ('description', models.CharField(verbose_name='description', max_length=256)), ('total', models.DecimalField(decimal_places=2, max_digits=12)), - ('type', models.CharField(verbose_name='type', default='OTHER', choices=[('VOLUME', 'Volume'), ('COMPENSATION', 'Compensation'), ('OTHER', 'Other')], max_length=16)), + ('type', models.CharField(default='OTHER', verbose_name='type', choices=[('VOLUME', 'Volume'), ('COMPENSATION', 'Compensation'), ('OTHER', 'Other')], max_length=16)), ('line', models.ForeignKey(related_name='sublines', to='bills.BillLine', verbose_name='bill line')), ], ), diff --git a/orchestra/contrib/bills/migrations/0002_auto_20150429_1343.py b/orchestra/contrib/bills/migrations/0002_auto_20150429_1343.py deleted file mode 100644 index 6a2d8c88..00000000 --- a/orchestra/contrib/bills/migrations/0002_auto_20150429_1343.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('bills', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='billcontact', - name='country', - field=models.CharField(verbose_name='country', choices=[('ZA', 'South Africa'), ('TG', 'Togo'), ('SZ', 'Swaziland'), ('MF', 'Saint Martin (French part)'), ('GG', 'Guernsey'), ('FR', 'France'), ('CR', 'Costa Rica'), ('NA', 'Namibia'), ('AD', 'Andorra'), ('NR', 'Nauru'), ('NU', 'Niue'), ('NP', 'Nepal'), ('BD', 'Bangladesh'), ('SK', 'Slovakia'), ('VC', 'Saint Vincent and the Grenadines'), ('SE', 'Sweden'), ('US', 'United States of America'), ('CH', 'Switzerland'), ('TZ', 'Tanzania, United Republic of'), ('SO', 'Somalia'), ('TC', 'Turks and Caicos Islands'), ('MX', 'Mexico'), ('SX', 'Sint Maarten (Dutch part)'), ('ID', 'Indonesia'), ('SL', 'Sierra Leone'), ('SN', 'Senegal'), ('PY', 'Paraguay'), ('PA', 'Panama'), ('KZ', 'Kazakhstan'), ('LA', "Lao People's Democratic Republic"), ('MT', 'Malta'), ('EE', 'Estonia'), ('KG', 'Kyrgyzstan'), ('LB', 'Lebanon'), ('BZ', 'Belize'), ('MR', 'Mauritania'), ('GE', 'Georgia'), ('KY', 'Cayman Islands'), ('VA', 'Holy See'), ('TM', 'Turkmenistan'), ('GI', 'Gibraltar'), ('HT', 'Haiti'), ('AE', 'United Arab Emirates'), ('BB', 'Barbados'), ('GT', 'Guatemala'), ('HN', 'Honduras'), ('CX', 'Christmas Island'), ('CL', 'Chile'), ('NO', 'Norway'), ('BN', 'Brunei Darussalam'), ('QA', 'Qatar'), ('BM', 'Bermuda'), ('HU', 'Hungary'), ('BA', 'Bosnia and Herzegovina'), ('ST', 'Sao Tome and Principe'), ('OM', 'Oman'), ('AS', 'American Samoa'), ('CO', 'Colombia'), ('KH', 'Cambodia'), ('SC', 'Seychelles'), ('GS', 'South Georgia and the South Sandwich Islands'), ('BO', 'Bolivia (Plurinational State of)'), ('MU', 'Mauritius'), ('CF', 'Central African Republic'), ('GD', 'Grenada'), ('MK', 'Macedonia (the former Yugoslav Republic of)'), ('EC', 'Ecuador'), ('PR', 'Puerto Rico'), ('LY', 'Libya'), ('ZM', 'Zambia'), ('PH', 'Philippines'), ('TN', 'Tunisia'), ('MS', 'Montserrat'), ('MH', 'Marshall Islands'), ('CA', 'Canada'), ('HR', 'Croatia'), ('KN', 'Saint Kitts and Nevis'), ('TR', 'Turkey'), ('GN', 'Guinea'), ('PL', 'Poland'), ('GB', 'United Kingdom of Great Britain and Northern Ireland'), ('IM', 'Isle of Man'), ('SY', 'Syrian Arab Republic'), ('TJ', 'Tajikistan'), ('AF', 'Afghanistan'), ('AL', 'Albania'), ('BW', 'Botswana'), ('BL', 'Saint Barthélemy'), ('LU', 'Luxembourg'), ('LC', 'Saint Lucia'), ('TV', 'Tuvalu'), ('GH', 'Ghana'), ('SV', 'El Salvador'), ('FK', 'Falkland Islands [Malvinas]'), ('GU', 'Guam'), ('CW', 'Curaçao'), ('ER', 'Eritrea'), ('PF', 'French Polynesia'), ('CM', 'Cameroon'), ('RE', 'Réunion'), ('DE', 'Germany'), ('MN', 'Mongolia'), ('MZ', 'Mozambique'), ('MA', 'Morocco'), ('PW', 'Palau'), ('BT', 'Bhutan'), ('PT', 'Portugal'), ('BJ', 'Benin'), ('AT', 'Austria'), ('MG', 'Madagascar'), ('AX', 'Åland Islands'), ('PS', 'Palestine, State of'), ('YE', 'Yemen'), ('WS', 'Samoa'), ('MD', 'Moldova (the Republic of)'), ('MQ', 'Martinique'), ('MC', 'Monaco'), ('GA', 'Gabon'), ('GQ', 'Equatorial Guinea'), ('MO', 'Macao'), ('CY', 'Cyprus'), ('ES', 'Spain'), ('NF', 'Norfolk Island'), ('CC', 'Cocos (Keeling) Islands'), ('HM', 'Heard Island and McDonald Islands'), ('KI', 'Kiribati'), ('DJ', 'Djibouti'), ('RS', 'Serbia'), ('KR', 'Korea (the Republic of)'), ('TT', 'Trinidad and Tobago'), ('CU', 'Cuba'), ('VE', 'Venezuela (Bolivarian Republic of)'), ('BV', 'Bouvet Island'), ('JE', 'Jersey'), ('SS', 'South Sudan'), ('GL', 'Greenland'), ('TF', 'French Southern Territories'), ('BI', 'Burundi'), ('VG', 'Virgin Islands (British)'), ('LR', 'Liberia'), ('NL', 'Netherlands'), ('UA', 'Ukraine'), ('TW', 'Taiwan (Province of China)'), ('GY', 'Guyana'), ('UZ', 'Uzbekistan'), ('TO', 'Tonga'), ('RU', 'Russian Federation'), ('HK', 'Hong Kong'), ('GF', 'French Guiana'), ('UY', 'Uruguay'), ('JM', 'Jamaica'), ('DO', 'Dominican Republic'), ('AW', 'Aruba'), ('LT', 'Lithuania'), ('BR', 'Brazil'), ('PN', 'Pitcairn'), ('SD', 'Sudan'), ('BG', 'Bulgaria'), ('MM', 'Myanmar'), ('SR', 'Suriname'), ('AR', 'Argentina'), ('AZ', 'Azerbaijan'), ('AQ', 'Antarctica'), ('FJ', 'Fiji'), ('AI', 'Anguilla'), ('GR', 'Greece'), ('CI', "Côte d'Ivoire"), ('LS', 'Lesotho'), ('GW', 'Guinea-Bissau'), ('AO', 'Angola'), ('IR', 'Iran (Islamic Republic of)'), ('LI', 'Liechtenstein'), ('MY', 'Malaysia'), ('CN', 'China'), ('KM', 'Comoros'), ('ML', 'Mali'), ('SJ', 'Svalbard and Jan Mayen'), ('PK', 'Pakistan'), ('IT', 'Italy'), ('AU', 'Australia'), ('UG', 'Uganda'), ('TH', 'Thailand'), ('CG', 'Congo'), ('IN', 'India'), ('ET', 'Ethiopia'), ('SH', 'Saint Helena, Ascension and Tristan da Cunha'), ('LV', 'Latvia'), ('SI', 'Slovenia'), ('CZ', 'Czech Republic'), ('NI', 'Nicaragua'), ('BS', 'Bahamas'), ('SA', 'Saudi Arabia'), ('IS', 'Iceland'), ('FI', 'Finland'), ('NC', 'New Caledonia'), ('ME', 'Montenegro'), ('ZW', 'Zimbabwe'), ('AM', 'Armenia'), ('PE', 'Peru'), ('GM', 'Gambia'), ('KP', "Korea (the Democratic People's Republic of)"), ('EG', 'Egypt'), ('BF', 'Burkina Faso'), ('PM', 'Saint Pierre and Miquelon'), ('TK', 'Tokelau'), ('FM', 'Micronesia (Federated States of)'), ('AG', 'Antigua and Barbuda'), ('VN', 'Viet Nam'), ('SG', 'Singapore'), ('BQ', 'Bonaire, Sint Eustatius and Saba'), ('KE', 'Kenya'), ('YT', 'Mayotte'), ('TD', 'Chad'), ('NE', 'Niger'), ('JO', 'Jordan'), ('IO', 'British Indian Ocean Territory'), ('FO', 'Faroe Islands'), ('CD', 'Congo (the Democratic Republic of the)'), ('IQ', 'Iraq'), ('IE', 'Ireland'), ('DK', 'Denmark'), ('RW', 'Rwanda'), ('VI', 'Virgin Islands (U.S.)'), ('JP', 'Japan'), ('TL', 'Timor-Leste'), ('PG', 'Papua New Guinea'), ('NG', 'Nigeria'), ('VU', 'Vanuatu'), ('LK', 'Sri Lanka'), ('SM', 'San Marino'), ('IL', 'Israel'), ('MP', 'Northern Mariana Islands'), ('WF', 'Wallis and Futuna'), ('SB', 'Solomon Islands'), ('DM', 'Dominica'), ('EH', 'Western Sahara'), ('KW', 'Kuwait'), ('RO', 'Romania'), ('BY', 'Belarus'), ('BE', 'Belgium'), ('CK', 'Cook Islands'), ('UM', 'United States Minor Outlying Islands'), ('MV', 'Maldives'), ('GP', 'Guadeloupe'), ('NZ', 'New Zealand'), ('MW', 'Malawi'), ('CV', 'Cabo Verde'), ('DZ', 'Algeria'), ('BH', 'Bahrain')], max_length=20, default='ES'), - ), - ] diff --git a/orchestra/contrib/bills/migrations/0002_auto_20150429_1417.py b/orchestra/contrib/bills/migrations/0002_auto_20150429_1417.py new file mode 100644 index 00000000..36d09695 --- /dev/null +++ b/orchestra/contrib/bills/migrations/0002_auto_20150429_1417.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('bills', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='billcontact', + name='country', + field=models.CharField(choices=[('EE', 'Estonia'), ('PH', 'Philippines'), ('BT', 'Bhutan'), ('LA', "Lao People's Democratic Republic"), ('DJ', 'Djibouti'), ('TK', 'Tokelau'), ('IM', 'Isle of Man'), ('SR', 'Suriname'), ('KP', "Korea (the Democratic People's Republic of)"), ('JP', 'Japan'), ('KN', 'Saint Kitts and Nevis'), ('SY', 'Syrian Arab Republic'), ('AG', 'Antigua and Barbuda'), ('RW', 'Rwanda'), ('PA', 'Panama'), ('CA', 'Canada'), ('MR', 'Mauritania'), ('HK', 'Hong Kong'), ('UM', 'United States Minor Outlying Islands'), ('BB', 'Barbados'), ('NF', 'Norfolk Island'), ('MK', 'Macedonia (the former Yugoslav Republic of)'), ('GS', 'South Georgia and the South Sandwich Islands'), ('FK', 'Falkland Islands [Malvinas]'), ('TF', 'French Southern Territories'), ('TV', 'Tuvalu'), ('SX', 'Sint Maarten (Dutch part)'), ('PW', 'Palau'), ('QA', 'Qatar'), ('GT', 'Guatemala'), ('KG', 'Kyrgyzstan'), ('HT', 'Haiti'), ('NG', 'Nigeria'), ('TG', 'Togo'), ('GR', 'Greece'), ('GF', 'French Guiana'), ('HN', 'Honduras'), ('CV', 'Cabo Verde'), ('DM', 'Dominica'), ('GB', 'United Kingdom of Great Britain and Northern Ireland'), ('ME', 'Montenegro'), ('SG', 'Singapore'), ('MT', 'Malta'), ('GG', 'Guernsey'), ('MW', 'Malawi'), ('GH', 'Ghana'), ('GN', 'Guinea'), ('EG', 'Egypt'), ('MD', 'Moldova (the Republic of)'), ('NE', 'Niger'), ('NR', 'Nauru'), ('IE', 'Ireland'), ('CY', 'Cyprus'), ('BH', 'Bahrain'), ('BY', 'Belarus'), ('TC', 'Turks and Caicos Islands'), ('CF', 'Central African Republic'), ('CI', "Côte d'Ivoire"), ('LK', 'Sri Lanka'), ('GW', 'Guinea-Bissau'), ('SZ', 'Swaziland'), ('YE', 'Yemen'), ('AQ', 'Antarctica'), ('WS', 'Samoa'), ('PN', 'Pitcairn'), ('AE', 'United Arab Emirates'), ('LV', 'Latvia'), ('CZ', 'Czech Republic'), ('JO', 'Jordan'), ('LU', 'Luxembourg'), ('RU', 'Russian Federation'), ('SN', 'Senegal'), ('SH', 'Saint Helena, Ascension and Tristan da Cunha'), ('SS', 'South Sudan'), ('LI', 'Liechtenstein'), ('GM', 'Gambia'), ('SO', 'Somalia'), ('AT', 'Austria'), ('AL', 'Albania'), ('MM', 'Myanmar'), ('MC', 'Monaco'), ('AZ', 'Azerbaijan'), ('KY', 'Cayman Islands'), ('HU', 'Hungary'), ('SE', 'Sweden'), ('US', 'United States of America'), ('MS', 'Montserrat'), ('MX', 'Mexico'), ('IR', 'Iran (Islamic Republic of)'), ('SK', 'Slovakia'), ('IO', 'British Indian Ocean Territory'), ('SV', 'El Salvador'), ('ST', 'Sao Tome and Principe'), ('ZW', 'Zimbabwe'), ('MN', 'Mongolia'), ('MG', 'Madagascar'), ('LB', 'Lebanon'), ('PR', 'Puerto Rico'), ('JE', 'Jersey'), ('BD', 'Bangladesh'), ('HM', 'Heard Island and McDonald Islands'), ('RO', 'Romania'), ('TN', 'Tunisia'), ('AD', 'Andorra'), ('SJ', 'Svalbard and Jan Mayen'), ('PL', 'Poland'), ('AF', 'Afghanistan'), ('NC', 'New Caledonia'), ('FI', 'Finland'), ('GD', 'Grenada'), ('GY', 'Guyana'), ('ZA', 'South Africa'), ('MA', 'Morocco'), ('AS', 'American Samoa'), ('PY', 'Paraguay'), ('ZM', 'Zambia'), ('PG', 'Papua New Guinea'), ('CH', 'Switzerland'), ('LY', 'Libya'), ('KZ', 'Kazakhstan'), ('SL', 'Sierra Leone'), ('DO', 'Dominican Republic'), ('TZ', 'Tanzania, United Republic of'), ('LC', 'Saint Lucia'), ('NI', 'Nicaragua'), ('TH', 'Thailand'), ('BI', 'Burundi'), ('SD', 'Sudan'), ('BW', 'Botswana'), ('VE', 'Venezuela (Bolivarian Republic of)'), ('TJ', 'Tajikistan'), ('CM', 'Cameroon'), ('EC', 'Ecuador'), ('ER', 'Eritrea'), ('CX', 'Christmas Island'), ('MO', 'Macao'), ('MH', 'Marshall Islands'), ('AU', 'Australia'), ('DK', 'Denmark'), ('TT', 'Trinidad and Tobago'), ('BE', 'Belgium'), ('SI', 'Slovenia'), ('PM', 'Saint Pierre and Miquelon'), ('KH', 'Cambodia'), ('CW', 'Curaçao'), ('EH', 'Western Sahara'), ('TO', 'Tonga'), ('AO', 'Angola'), ('OM', 'Oman'), ('GE', 'Georgia'), ('MF', 'Saint Martin (French part)'), ('IT', 'Italy'), ('UA', 'Ukraine'), ('BA', 'Bosnia and Herzegovina'), ('WF', 'Wallis and Futuna'), ('FM', 'Micronesia (Federated States of)'), ('BO', 'Bolivia (Plurinational State of)'), ('PF', 'French Polynesia'), ('DE', 'Germany'), ('BZ', 'Belize'), ('IS', 'Iceland'), ('MY', 'Malaysia'), ('IQ', 'Iraq'), ('KR', 'Korea (the Republic of)'), ('CN', 'China'), ('SB', 'Solomon Islands'), ('TL', 'Timor-Leste'), ('TD', 'Chad'), ('PE', 'Peru'), ('BL', 'Saint Barthélemy'), ('CL', 'Chile'), ('KI', 'Kiribati'), ('PT', 'Portugal'), ('ES', 'Spain'), ('IL', 'Israel'), ('MU', 'Mauritius'), ('HR', 'Croatia'), ('PK', 'Pakistan'), ('PS', 'Palestine, State of'), ('NL', 'Netherlands'), ('CG', 'Congo'), ('MQ', 'Martinique'), ('BG', 'Bulgaria'), ('FR', 'France'), ('VI', 'Virgin Islands (U.S.)'), ('LT', 'Lithuania'), ('BN', 'Brunei Darussalam'), ('ET', 'Ethiopia'), ('NU', 'Niue'), ('AR', 'Argentina'), ('DZ', 'Algeria'), ('RS', 'Serbia'), ('UZ', 'Uzbekistan'), ('SM', 'San Marino'), ('JM', 'Jamaica'), ('VN', 'Viet Nam'), ('AM', 'Armenia'), ('KE', 'Kenya'), ('CO', 'Colombia'), ('LS', 'Lesotho'), ('GP', 'Guadeloupe'), ('GA', 'Gabon'), ('KM', 'Comoros'), ('BS', 'Bahamas'), ('TW', 'Taiwan (Province of China)'), ('RE', 'Réunion'), ('AW', 'Aruba'), ('BV', 'Bouvet Island'), ('UG', 'Uganda'), ('BQ', 'Bonaire, Sint Eustatius and Saba'), ('BF', 'Burkina Faso'), ('NP', 'Nepal'), ('VG', 'Virgin Islands (British)'), ('SA', 'Saudi Arabia'), ('AX', 'Åland Islands'), ('TM', 'Turkmenistan'), ('IN', 'India'), ('CC', 'Cocos (Keeling) Islands'), ('FO', 'Faroe Islands'), ('BJ', 'Benin'), ('BM', 'Bermuda'), ('ID', 'Indonesia'), ('NA', 'Namibia'), ('TR', 'Turkey'), ('GI', 'Gibraltar'), ('GQ', 'Equatorial Guinea'), ('GU', 'Guam'), ('ML', 'Mali'), ('SC', 'Seychelles'), ('MP', 'Northern Mariana Islands'), ('LR', 'Liberia'), ('CK', 'Cook Islands'), ('VA', 'Holy See'), ('FJ', 'Fiji'), ('YT', 'Mayotte'), ('NZ', 'New Zealand'), ('CU', 'Cuba'), ('AI', 'Anguilla'), ('VC', 'Saint Vincent and the Grenadines'), ('MV', 'Maldives'), ('GL', 'Greenland'), ('NO', 'Norway'), ('BR', 'Brazil'), ('CD', 'Congo (the Democratic Republic of the)'), ('CR', 'Costa Rica'), ('VU', 'Vanuatu'), ('MZ', 'Mozambique'), ('KW', 'Kuwait'), ('UY', 'Uruguay')], verbose_name='country', max_length=20, default='ES'), + ), + ] diff --git a/orchestra/contrib/contacts/migrations/0001_initial.py b/orchestra/contrib/contacts/migrations/0001_initial.py index e3334496..5b66d4cf 100644 --- a/orchestra/contrib/contacts/migrations/0001_initial.py +++ b/orchestra/contrib/contacts/migrations/0001_initial.py @@ -2,10 +2,10 @@ from __future__ import unicode_literals from django.db import models, migrations -import orchestra.contrib.contacts.validators -from django.conf import settings import django.core.validators +import orchestra.contrib.contacts.validators import orchestra.models.fields +from django.conf import settings class Migration(migrations.Migration): @@ -18,17 +18,17 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Contact', fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)), + ('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')), ('short_name', models.CharField(max_length=128, verbose_name='short name')), - ('full_name', models.CharField(max_length=256, blank=True, verbose_name='full name')), + ('full_name', models.CharField(max_length=256, verbose_name='full name', blank=True)), ('email', models.EmailField(max_length=254)), - ('email_usage', orchestra.models.fields.MultiSelectField(max_length=256, blank=True, default=('SUPPORT', 'ADMIN', 'BILLING', 'TECH', 'ADDS', 'EMERGENCY'), verbose_name='email usage', choices=[('SUPPORT', 'Support tickets'), ('ADMIN', 'Administrative'), ('BILLING', 'Billing'), ('TECH', 'Technical'), ('ADDS', 'Announcements'), ('EMERGENCY', 'Emergency contact')])), - ('phone', models.CharField(max_length=32, blank=True, verbose_name='phone', validators=[orchestra.contrib.contacts.validators.validate_phone])), - ('phone2', models.CharField(max_length=32, blank=True, verbose_name='alternative phone', validators=[orchestra.contrib.contacts.validators.validate_phone])), - ('address', models.TextField(blank=True, verbose_name='address')), - ('city', models.CharField(max_length=128, blank=True, verbose_name='city')), - ('zipcode', models.CharField(max_length=10, blank=True, verbose_name='zip code', validators=[django.core.validators.RegexValidator('^[0-9,A-Z]{3,10}$', 'Enter a valid zipcode.', 'invalid')])), - ('country', models.CharField(max_length=20, blank=True, default='ES', verbose_name='country', choices=[('AU', 'Australia'), ('RS', 'Serbia'), ('BO', 'Bolivia (Plurinational State of)'), ('KG', 'Kyrgyzstan'), ('LV', 'Latvia'), ('IN', 'India'), ('ET', 'Ethiopia'), ('VC', 'Saint Vincent and the Grenadines'), ('HK', 'Hong Kong'), ('CA', 'Canada'), ('TZ', 'Tanzania, United Republic of'), ('BB', 'Barbados'), ('VI', 'Virgin Islands (U.S.)'), ('RE', 'Réunion'), ('DE', 'Germany'), ('GQ', 'Equatorial Guinea'), ('DK', 'Denmark'), ('BL', 'Saint Barthélemy'), ('GA', 'Gabon'), ('KM', 'Comoros'), ('AF', 'Afghanistan'), ('MS', 'Montserrat'), ('MO', 'Macao'), ('MD', 'Moldova (the Republic of)'), ('LS', 'Lesotho'), ('GD', 'Grenada'), ('LY', 'Libya'), ('SH', 'Saint Helena, Ascension and Tristan da Cunha'), ('IM', 'Isle of Man'), ('BS', 'Bahamas'), ('GY', 'Guyana'), ('LT', 'Lithuania'), ('ZM', 'Zambia'), ('LU', 'Luxembourg'), ('CN', 'China'), ('HU', 'Hungary'), ('FM', 'Micronesia (Federated States of)'), ('NU', 'Niue'), ('VE', 'Venezuela (Bolivarian Republic of)'), ('TR', 'Turkey'), ('PH', 'Philippines'), ('CG', 'Congo'), ('IL', 'Israel'), ('MZ', 'Mozambique'), ('NI', 'Nicaragua'), ('CY', 'Cyprus'), ('HM', 'Heard Island and McDonald Islands'), ('BH', 'Bahrain'), ('AT', 'Austria'), ('KR', 'Korea (the Republic of)'), ('MA', 'Morocco'), ('KZ', 'Kazakhstan'), ('WS', 'Samoa'), ('US', 'United States of America'), ('DJ', 'Djibouti'), ('CC', 'Cocos (Keeling) Islands'), ('TO', 'Tonga'), ('GU', 'Guam'), ('MC', 'Monaco'), ('AO', 'Angola'), ('MH', 'Marshall Islands'), ('GG', 'Guernsey'), ('LA', "Lao People's Democratic Republic"), ('CX', 'Christmas Island'), ('BN', 'Brunei Darussalam'), ('SV', 'El Salvador'), ('EC', 'Ecuador'), ('CK', 'Cook Islands'), ('IT', 'Italy'), ('ML', 'Mali'), ('CU', 'Cuba'), ('TG', 'Togo'), ('CI', "Côte d'Ivoire"), ('ST', 'Sao Tome and Principe'), ('FO', 'Faroe Islands'), ('HR', 'Croatia'), ('ES', 'Spain'), ('UY', 'Uruguay'), ('BE', 'Belgium'), ('MX', 'Mexico'), ('YE', 'Yemen'), ('CH', 'Switzerland'), ('PM', 'Saint Pierre and Miquelon'), ('SN', 'Senegal'), ('SO', 'Somalia'), ('AM', 'Armenia'), ('SY', 'Syrian Arab Republic'), ('NC', 'New Caledonia'), ('CO', 'Colombia'), ('BF', 'Burkina Faso'), ('GS', 'South Georgia and the South Sandwich Islands'), ('NR', 'Nauru'), ('ME', 'Montenegro'), ('PY', 'Paraguay'), ('BA', 'Bosnia and Herzegovina'), ('WF', 'Wallis and Futuna'), ('NA', 'Namibia'), ('EE', 'Estonia'), ('SM', 'San Marino'), ('SL', 'Sierra Leone'), ('LK', 'Sri Lanka'), ('AR', 'Argentina'), ('GW', 'Guinea-Bissau'), ('DM', 'Dominica'), ('BQ', 'Bonaire, Sint Eustatius and Saba'), ('TM', 'Turkmenistan'), ('VU', 'Vanuatu'), ('KE', 'Kenya'), ('KY', 'Cayman Islands'), ('TF', 'French Southern Territories'), ('JM', 'Jamaica'), ('AE', 'United Arab Emirates'), ('TL', 'Timor-Leste'), ('GF', 'French Guiana'), ('GH', 'Ghana'), ('TC', 'Turks and Caicos Islands'), ('CZ', 'Czech Republic'), ('KW', 'Kuwait'), ('HT', 'Haiti'), ('CM', 'Cameroon'), ('GR', 'Greece'), ('UZ', 'Uzbekistan'), ('PT', 'Portugal'), ('BJ', 'Benin'), ('SR', 'Suriname'), ('CR', 'Costa Rica'), ('BV', 'Bouvet Island'), ('NF', 'Norfolk Island'), ('ER', 'Eritrea'), ('MT', 'Malta'), ('SA', 'Saudi Arabia'), ('MK', 'Macedonia (the former Yugoslav Republic of)'), ('AD', 'Andorra'), ('BY', 'Belarus'), ('KP', "Korea (the Democratic People's Republic of)"), ('SC', 'Seychelles'), ('IE', 'Ireland'), ('UG', 'Uganda'), ('LR', 'Liberia'), ('PN', 'Pitcairn'), ('MM', 'Myanmar'), ('SJ', 'Svalbard and Jan Mayen'), ('EH', 'Western Sahara'), ('LC', 'Saint Lucia'), ('MQ', 'Martinique'), ('ZW', 'Zimbabwe'), ('FR', 'France'), ('BM', 'Bermuda'), ('NP', 'Nepal'), ('BD', 'Bangladesh'), ('CW', 'Curaçao'), ('JE', 'Jersey'), ('IS', 'Iceland'), ('PG', 'Papua New Guinea'), ('GI', 'Gibraltar'), ('SX', 'Sint Maarten (Dutch part)'), ('IR', 'Iran (Islamic Republic of)'), ('TT', 'Trinidad and Tobago'), ('TD', 'Chad'), ('SZ', 'Swaziland'), ('MW', 'Malawi'), ('PE', 'Peru'), ('TN', 'Tunisia'), ('NZ', 'New Zealand'), ('CD', 'Congo (the Democratic Republic of the)'), ('RW', 'Rwanda'), ('IQ', 'Iraq'), ('GB', 'United Kingdom of Great Britain and Northern Ireland'), ('FI', 'Finland'), ('LI', 'Liechtenstein'), ('UA', 'Ukraine'), ('AQ', 'Antarctica'), ('KH', 'Cambodia'), ('BG', 'Bulgaria'), ('SK', 'Slovakia'), ('OM', 'Oman'), ('AZ', 'Azerbaijan'), ('ZA', 'South Africa'), ('CF', 'Central African Republic'), ('SD', 'Sudan'), ('FK', 'Falkland Islands [Malvinas]'), ('SB', 'Solomon Islands'), ('ID', 'Indonesia'), ('QA', 'Qatar'), ('MY', 'Malaysia'), ('TH', 'Thailand'), ('CL', 'Chile'), ('TK', 'Tokelau'), ('AL', 'Albania'), ('JP', 'Japan'), ('GM', 'Gambia'), ('VG', 'Virgin Islands (British)'), ('KI', 'Kiribati'), ('MN', 'Mongolia'), ('HN', 'Honduras'), ('SE', 'Sweden'), ('YT', 'Mayotte'), ('UM', 'United States Minor Outlying Islands'), ('NG', 'Nigeria'), ('MF', 'Saint Martin (French part)'), ('NL', 'Netherlands'), ('AX', 'Åland Islands'), ('PS', 'Palestine, State of'), ('GN', 'Guinea'), ('IO', 'British Indian Ocean Territory'), ('SG', 'Singapore'), ('RO', 'Romania'), ('NO', 'Norway'), ('PA', 'Panama'), ('FJ', 'Fiji'), ('CV', 'Cabo Verde'), ('MP', 'Northern Mariana Islands'), ('GE', 'Georgia'), ('PW', 'Palau'), ('VA', 'Holy See'), ('NE', 'Niger'), ('RU', 'Russian Federation'), ('AS', 'American Samoa'), ('MR', 'Mauritania'), ('GP', 'Guadeloupe'), ('BT', 'Bhutan'), ('KN', 'Saint Kitts and Nevis'), ('AI', 'Anguilla'), ('GL', 'Greenland'), ('PK', 'Pakistan'), ('PF', 'French Polynesia'), ('DO', 'Dominican Republic'), ('BR', 'Brazil'), ('JO', 'Jordan'), ('TW', 'Taiwan (Province of China)'), ('TV', 'Tuvalu'), ('MU', 'Mauritius'), ('BW', 'Botswana'), ('EG', 'Egypt'), ('BZ', 'Belize'), ('LB', 'Lebanon'), ('GT', 'Guatemala'), ('MV', 'Maldives'), ('PL', 'Poland'), ('TJ', 'Tajikistan'), ('MG', 'Madagascar'), ('VN', 'Viet Nam'), ('SI', 'Slovenia'), ('AG', 'Antigua and Barbuda'), ('DZ', 'Algeria'), ('PR', 'Puerto Rico'), ('SS', 'South Sudan'), ('BI', 'Burundi'), ('AW', 'Aruba')])), + ('email_usage', orchestra.models.fields.MultiSelectField(choices=[('SUPPORT', 'Support tickets'), ('ADMIN', 'Administrative'), ('BILLING', 'Billing'), ('TECH', 'Technical'), ('ADDS', 'Announcements'), ('EMERGENCY', 'Emergency contact')], max_length=256, default=('SUPPORT', 'ADMIN', 'BILLING', 'TECH', 'ADDS', 'EMERGENCY'), verbose_name='email usage', blank=True)), + ('phone', models.CharField(max_length=32, blank=True, validators=[orchestra.contrib.contacts.validators.validate_phone], verbose_name='phone')), + ('phone2', models.CharField(max_length=32, blank=True, validators=[orchestra.contrib.contacts.validators.validate_phone], verbose_name='alternative phone')), + ('address', models.TextField(verbose_name='address', blank=True)), + ('city', models.CharField(max_length=128, verbose_name='city', blank=True)), + ('zipcode', models.CharField(max_length=10, blank=True, validators=[django.core.validators.RegexValidator('^[0-9,A-Z]{3,10}$', 'Enter a valid zipcode.', 'invalid')], verbose_name='zip code')), + ('country', models.CharField(choices=[('VC', 'Saint Vincent and the Grenadines'), ('TM', 'Turkmenistan'), ('CL', 'Chile'), ('BN', 'Brunei Darussalam'), ('IS', 'Iceland'), ('AM', 'Armenia'), ('FI', 'Finland'), ('TK', 'Tokelau'), ('AF', 'Afghanistan'), ('IE', 'Ireland'), ('CW', 'Curaçao'), ('PY', 'Paraguay'), ('WF', 'Wallis and Futuna'), ('PK', 'Pakistan'), ('JP', 'Japan'), ('AO', 'Angola'), ('FM', 'Micronesia (Federated States of)'), ('SH', 'Saint Helena, Ascension and Tristan da Cunha'), ('SG', 'Singapore'), ('BL', 'Saint Barthélemy'), ('MK', 'Macedonia (the former Yugoslav Republic of)'), ('MY', 'Malaysia'), ('IM', 'Isle of Man'), ('GW', 'Guinea-Bissau'), ('IQ', 'Iraq'), ('GR', 'Greece'), ('VA', 'Holy See'), ('RW', 'Rwanda'), ('GD', 'Grenada'), ('TZ', 'Tanzania, United Republic of'), ('DZ', 'Algeria'), ('BF', 'Burkina Faso'), ('HU', 'Hungary'), ('TT', 'Trinidad and Tobago'), ('LU', 'Luxembourg'), ('BA', 'Bosnia and Herzegovina'), ('ET', 'Ethiopia'), ('TG', 'Togo'), ('RU', 'Russian Federation'), ('EG', 'Egypt'), ('RO', 'Romania'), ('SR', 'Suriname'), ('GB', 'United Kingdom of Great Britain and Northern Ireland'), ('JM', 'Jamaica'), ('HK', 'Hong Kong'), ('BH', 'Bahrain'), ('KM', 'Comoros'), ('HN', 'Honduras'), ('TD', 'Chad'), ('RS', 'Serbia'), ('PH', 'Philippines'), ('PE', 'Peru'), ('UA', 'Ukraine'), ('AE', 'United Arab Emirates'), ('KW', 'Kuwait'), ('GE', 'Georgia'), ('NA', 'Namibia'), ('CZ', 'Czech Republic'), ('CY', 'Cyprus'), ('LA', "Lao People's Democratic Republic"), ('BZ', 'Belize'), ('MX', 'Mexico'), ('MZ', 'Mozambique'), ('FR', 'France'), ('KG', 'Kyrgyzstan'), ('PW', 'Palau'), ('MG', 'Madagascar'), ('AU', 'Australia'), ('AI', 'Anguilla'), ('UZ', 'Uzbekistan'), ('NL', 'Netherlands'), ('VI', 'Virgin Islands (U.S.)'), ('LT', 'Lithuania'), ('WS', 'Samoa'), ('PA', 'Panama'), ('CO', 'Colombia'), ('AL', 'Albania'), ('PN', 'Pitcairn'), ('SC', 'Seychelles'), ('CH', 'Switzerland'), ('DO', 'Dominican Republic'), ('AW', 'Aruba'), ('GH', 'Ghana'), ('MM', 'Myanmar'), ('ML', 'Mali'), ('PS', 'Palestine, State of'), ('UY', 'Uruguay'), ('MN', 'Mongolia'), ('NE', 'Niger'), ('FK', 'Falkland Islands [Malvinas]'), ('US', 'United States of America'), ('BD', 'Bangladesh'), ('SB', 'Solomon Islands'), ('ZA', 'South Africa'), ('SJ', 'Svalbard and Jan Mayen'), ('IT', 'Italy'), ('HT', 'Haiti'), ('BW', 'Botswana'), ('MA', 'Morocco'), ('GP', 'Guadeloupe'), ('NI', 'Nicaragua'), ('CU', 'Cuba'), ('GL', 'Greenland'), ('MQ', 'Martinique'), ('NZ', 'New Zealand'), ('DE', 'Germany'), ('GY', 'Guyana'), ('YT', 'Mayotte'), ('MR', 'Mauritania'), ('IR', 'Iran (Islamic Republic of)'), ('SL', 'Sierra Leone'), ('MD', 'Moldova (the Republic of)'), ('SM', 'San Marino'), ('SS', 'South Sudan'), ('DM', 'Dominica'), ('NG', 'Nigeria'), ('UM', 'United States Minor Outlying Islands'), ('BI', 'Burundi'), ('GU', 'Guam'), ('GQ', 'Equatorial Guinea'), ('UG', 'Uganda'), ('VU', 'Vanuatu'), ('GT', 'Guatemala'), ('TR', 'Turkey'), ('BO', 'Bolivia (Plurinational State of)'), ('MP', 'Northern Mariana Islands'), ('AQ', 'Antarctica'), ('BS', 'Bahamas'), ('SK', 'Slovakia'), ('BY', 'Belarus'), ('AR', 'Argentina'), ('QA', 'Qatar'), ('LV', 'Latvia'), ('EH', 'Western Sahara'), ('LK', 'Sri Lanka'), ('LB', 'Lebanon'), ('JE', 'Jersey'), ('DJ', 'Djibouti'), ('LC', 'Saint Lucia'), ('CF', 'Central African Republic'), ('KE', 'Kenya'), ('NF', 'Norfolk Island'), ('FO', 'Faroe Islands'), ('BQ', 'Bonaire, Sint Eustatius and Saba'), ('TF', 'French Southern Territories'), ('TC', 'Turks and Caicos Islands'), ('GM', 'Gambia'), ('PF', 'French Polynesia'), ('DK', 'Denmark'), ('GI', 'Gibraltar'), ('SN', 'Senegal'), ('ER', 'Eritrea'), ('CR', 'Costa Rica'), ('AZ', 'Azerbaijan'), ('BR', 'Brazil'), ('SE', 'Sweden'), ('SI', 'Slovenia'), ('SV', 'El Salvador'), ('TO', 'Tonga'), ('LR', 'Liberia'), ('CV', 'Cabo Verde'), ('OM', 'Oman'), ('KR', 'Korea (the Republic of)'), ('BV', 'Bouvet Island'), ('CA', 'Canada'), ('CK', 'Cook Islands'), ('BG', 'Bulgaria'), ('ZW', 'Zimbabwe'), ('FJ', 'Fiji'), ('NU', 'Niue'), ('YE', 'Yemen'), ('CM', 'Cameroon'), ('ZM', 'Zambia'), ('MC', 'Monaco'), ('SX', 'Sint Maarten (Dutch part)'), ('VG', 'Virgin Islands (British)'), ('AD', 'Andorra'), ('MF', 'Saint Martin (French part)'), ('PM', 'Saint Pierre and Miquelon'), ('RE', 'Réunion'), ('SO', 'Somalia'), ('AG', 'Antigua and Barbuda'), ('MH', 'Marshall Islands'), ('TW', 'Taiwan (Province of China)'), ('EE', 'Estonia'), ('NP', 'Nepal'), ('TV', 'Tuvalu'), ('NC', 'New Caledonia'), ('ME', 'Montenegro'), ('CX', 'Christmas Island'), ('LY', 'Libya'), ('KP', "Korea (the Democratic People's Republic of)"), ('SD', 'Sudan'), ('VE', 'Venezuela (Bolivarian Republic of)'), ('KZ', 'Kazakhstan'), ('MV', 'Maldives'), ('CI', "Côte d'Ivoire"), ('VN', 'Viet Nam'), ('IN', 'India'), ('GN', 'Guinea'), ('AX', 'Åland Islands'), ('ST', 'Sao Tome and Principe'), ('HR', 'Croatia'), ('HM', 'Heard Island and McDonald Islands'), ('MO', 'Macao'), ('MS', 'Montserrat'), ('AT', 'Austria'), ('NO', 'Norway'), ('BT', 'Bhutan'), ('PT', 'Portugal'), ('IO', 'British Indian Ocean Territory'), ('KN', 'Saint Kitts and Nevis'), ('PL', 'Poland'), ('MW', 'Malawi'), ('LS', 'Lesotho'), ('SZ', 'Swaziland'), ('TJ', 'Tajikistan'), ('NR', 'Nauru'), ('MT', 'Malta'), ('ES', 'Spain'), ('BB', 'Barbados'), ('CG', 'Congo'), ('PG', 'Papua New Guinea'), ('GS', 'South Georgia and the South Sandwich Islands'), ('TN', 'Tunisia'), ('MU', 'Mauritius'), ('TH', 'Thailand'), ('BJ', 'Benin'), ('KY', 'Cayman Islands'), ('ID', 'Indonesia'), ('CD', 'Congo (the Democratic Republic of the)'), ('KI', 'Kiribati'), ('IL', 'Israel'), ('CN', 'China'), ('SA', 'Saudi Arabia'), ('AS', 'American Samoa'), ('KH', 'Cambodia'), ('JO', 'Jordan'), ('SY', 'Syrian Arab Republic'), ('LI', 'Liechtenstein'), ('GF', 'French Guiana'), ('EC', 'Ecuador'), ('CC', 'Cocos (Keeling) Islands'), ('TL', 'Timor-Leste'), ('BE', 'Belgium'), ('PR', 'Puerto Rico'), ('GA', 'Gabon'), ('BM', 'Bermuda'), ('GG', 'Guernsey')], max_length=20, default='ES', verbose_name='country', blank=True)), ('account', models.ForeignKey(null=True, related_name='contacts', to=settings.AUTH_USER_MODEL, verbose_name='Account')), ], ), diff --git a/orchestra/contrib/databases/migrations/0001_initial.py b/orchestra/contrib/databases/migrations/0001_initial.py index 838aeed4..47b3ff1b 100644 --- a/orchestra/contrib/databases/migrations/0001_initial.py +++ b/orchestra/contrib/databases/migrations/0001_initial.py @@ -16,20 +16,20 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Database', fields=[ - ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)), - ('name', models.CharField(validators=[orchestra.core.validators.validate_name], verbose_name='name', max_length=64)), - ('type', models.CharField(max_length=32, verbose_name='type', choices=[('mysql', 'MySQL')], default='mysql')), - ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='Account', related_name='databases')), + ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)), + ('name', models.CharField(verbose_name='name', max_length=64, validators=[orchestra.core.validators.validate_name])), + ('type', models.CharField(default='mysql', choices=[('mysql', 'MySQL'), ('postgres', 'PostgreSQL')], verbose_name='type', max_length=32)), + ('account', models.ForeignKey(related_name='databases', verbose_name='Account', to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='DatabaseUser', fields=[ - ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)), - ('username', models.CharField(validators=[orchestra.core.validators.validate_name], verbose_name='username', max_length=16)), + ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)), + ('username', models.CharField(verbose_name='username', max_length=16, validators=[orchestra.core.validators.validate_name])), ('password', models.CharField(verbose_name='password', max_length=256)), - ('type', models.CharField(max_length=32, verbose_name='type', choices=[('mysql', 'MySQL')], default='mysql')), - ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='Account', related_name='databaseusers')), + ('type', models.CharField(default='mysql', choices=[('mysql', 'MySQL'), ('postgres', 'PostgreSQL')], verbose_name='type', max_length=32)), + ('account', models.ForeignKey(related_name='databaseusers', verbose_name='Account', to=settings.AUTH_USER_MODEL)), ], options={ 'verbose_name_plural': 'DB users', @@ -38,7 +38,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='database', name='users', - field=models.ManyToManyField(to='databases.DatabaseUser', verbose_name='users', blank=True, related_name='databases'), + field=models.ManyToManyField(related_name='databases', to='databases.DatabaseUser', verbose_name='users', blank=True), ), migrations.AlterUniqueTogether( name='databaseuser', diff --git a/orchestra/contrib/domains/migrations/0001_initial.py b/orchestra/contrib/domains/migrations/0001_initial.py index dca8d048..cb58ca78 100644 --- a/orchestra/contrib/domains/migrations/0001_initial.py +++ b/orchestra/contrib/domains/migrations/0001_initial.py @@ -17,21 +17,21 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Domain', fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(validators=[orchestra.contrib.domains.validators.validate_domain_name, orchestra.contrib.domains.validators.validate_allowed_domain], max_length=256, help_text='Domain or subdomain name.', unique=True, verbose_name='name')), - ('serial', models.IntegerField(default=orchestra.contrib.domains.utils.generate_zone_serial, help_text='Serial number', verbose_name='serial')), - ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='Account', blank=True, help_text='Automatically selected for subdomains.', related_name='domains')), - ('top', models.ForeignKey(to='domains.Domain', null=True, editable=False, related_name='subdomain_set')), + ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), + ('name', models.CharField(unique=True, max_length=256, validators=[orchestra.contrib.domains.validators.validate_domain_name, orchestra.contrib.domains.validators.validate_allowed_domain], verbose_name='name', help_text='Domain or subdomain name.')), + ('serial', models.IntegerField(default=orchestra.contrib.domains.utils.generate_zone_serial, verbose_name='serial', help_text='Serial number')), + ('account', models.ForeignKey(related_name='domains', help_text='Automatically selected for subdomains.', to=settings.AUTH_USER_MODEL, verbose_name='Account', blank=True)), + ('top', models.ForeignKey(null=True, to='domains.Domain', editable=False, related_name='subdomain_set')), ], ), migrations.CreateModel( name='Record', fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('ttl', models.CharField(validators=[orchestra.contrib.domains.validators.validate_zone_interval], max_length=8, help_text='Record TTL, defaults to 1h', blank=True, verbose_name='TTL')), - ('type', models.CharField(max_length=32, choices=[('MX', 'MX'), ('NS', 'NS'), ('CNAME', 'CNAME'), ('A', 'A (IPv4 address)'), ('AAAA', 'AAAA (IPv6 address)'), ('SRV', 'SRV'), ('TXT', 'TXT'), ('SOA', 'SOA')], verbose_name='type')), + ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), + ('ttl', models.CharField(help_text='Record TTL, defaults to 1h', max_length=8, validators=[orchestra.contrib.domains.validators.validate_zone_interval], verbose_name='TTL', blank=True)), + ('type', models.CharField(max_length=32, verbose_name='type', choices=[('MX', 'MX'), ('NS', 'NS'), ('CNAME', 'CNAME'), ('A', 'A (IPv4 address)'), ('AAAA', 'AAAA (IPv6 address)'), ('SRV', 'SRV'), ('TXT', 'TXT'), ('SOA', 'SOA')])), ('value', models.CharField(max_length=256, verbose_name='value')), - ('domain', models.ForeignKey(to='domains.Domain', verbose_name='domain', related_name='records')), + ('domain', models.ForeignKey(related_name='records', to='domains.Domain', verbose_name='domain')), ], ), ] diff --git a/orchestra/contrib/issues/migrations/0001_initial.py b/orchestra/contrib/issues/migrations/0001_initial.py index 73ababd8..1dd5d46a 100644 --- a/orchestra/contrib/issues/migrations/0001_initial.py +++ b/orchestra/contrib/issues/migrations/0001_initial.py @@ -16,10 +16,10 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Message', fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)), - ('author_name', models.CharField(verbose_name='author name', max_length=256, blank=True)), + ('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')), + ('author_name', models.CharField(blank=True, max_length=256, verbose_name='author name')), ('content', models.TextField(verbose_name='content')), - ('created_on', models.DateTimeField(verbose_name='created on', auto_now_add=True)), + ('created_on', models.DateTimeField(auto_now_add=True, verbose_name='created on')), ('author', models.ForeignKey(related_name='ticket_messages', to=settings.AUTH_USER_MODEL, verbose_name='author')), ], options={ @@ -29,28 +29,28 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Queue', fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)), - ('name', models.CharField(unique=True, verbose_name='name', max_length=128)), - ('verbose_name', models.CharField(verbose_name='verbose_name', max_length=128, blank=True)), - ('default', models.BooleanField(default=False, verbose_name='default')), - ('notify', orchestra.models.fields.MultiSelectField(choices=[('SUPPORT', 'Support tickets'), ('ADMIN', 'Administrative'), ('BILLING', 'Billing'), ('TECH', 'Technical'), ('ADDS', 'Announcements'), ('EMERGENCY', 'Emergency contact')], help_text='Contacts to notify by email', verbose_name='notify', blank=True, default=('SUPPORT', 'ADMIN', 'BILLING', 'TECH', 'ADDS', 'EMERGENCY'), max_length=256)), + ('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')), + ('name', models.CharField(max_length=128, verbose_name='name', unique=True)), + ('verbose_name', models.CharField(blank=True, max_length=128, verbose_name='verbose_name')), + ('default', models.BooleanField(verbose_name='default', default=False)), + ('notify', orchestra.models.fields.MultiSelectField(blank=True, max_length=256, help_text='Contacts to notify by email', verbose_name='notify', default=('SUPPORT', 'ADMIN', 'BILLING', 'TECH', 'ADDS', 'EMERGENCY'), choices=[('SUPPORT', 'Support tickets'), ('ADMIN', 'Administrative'), ('BILLING', 'Billing'), ('TECH', 'Technical'), ('ADDS', 'Announcements'), ('EMERGENCY', 'Emergency contact')])), ], ), migrations.CreateModel( name='Ticket', fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)), - ('creator_name', models.CharField(verbose_name='creator name', max_length=256, blank=True)), - ('subject', models.CharField(verbose_name='subject', max_length=256)), + ('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')), + ('creator_name', models.CharField(blank=True, max_length=256, verbose_name='creator name')), + ('subject', models.CharField(max_length=256, verbose_name='subject')), ('description', models.TextField(verbose_name='description')), - ('priority', models.CharField(choices=[('HIGH', 'High'), ('MEDIUM', 'Medium'), ('LOW', 'Low')], default='MEDIUM', max_length=32, verbose_name='priority')), - ('state', models.CharField(choices=[('NEW', 'New'), ('IN_PROGRESS', 'In Progress'), ('RESOLVED', 'Resolved'), ('FEEDBACK', 'Feedback'), ('REJECTED', 'Rejected'), ('CLOSED', 'Closed')], default='NEW', max_length=32, verbose_name='state')), - ('created_at', models.DateTimeField(verbose_name='created', auto_now_add=True)), - ('updated_at', models.DateTimeField(verbose_name='modified', auto_now=True)), - ('cc', models.TextField(help_text='emails to send a carbon copy to', verbose_name='CC', blank=True)), - ('creator', models.ForeignKey(null=True, related_name='tickets_created', to=settings.AUTH_USER_MODEL, verbose_name='created by')), - ('owner', models.ForeignKey(null=True, related_name='tickets_owned', blank=True, to=settings.AUTH_USER_MODEL, verbose_name='assigned to')), - ('queue', models.ForeignKey(null=True, related_name='tickets', blank=True, to='issues.Queue')), + ('priority', models.CharField(max_length=32, default='MEDIUM', verbose_name='priority', choices=[('HIGH', 'High'), ('MEDIUM', 'Medium'), ('LOW', 'Low')])), + ('state', models.CharField(max_length=32, default='NEW', verbose_name='state', choices=[('NEW', 'New'), ('IN_PROGRESS', 'In Progress'), ('RESOLVED', 'Resolved'), ('FEEDBACK', 'Feedback'), ('REJECTED', 'Rejected'), ('CLOSED', 'Closed')])), + ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created')), + ('updated_at', models.DateTimeField(auto_now=True, verbose_name='modified')), + ('cc', models.TextField(blank=True, help_text='emails to send a carbon copy to', verbose_name='CC')), + ('creator', models.ForeignKey(related_name='tickets_created', null=True, to=settings.AUTH_USER_MODEL, verbose_name='created by')), + ('owner', models.ForeignKey(blank=True, related_name='tickets_owned', null=True, to=settings.AUTH_USER_MODEL, verbose_name='assigned to')), + ('queue', models.ForeignKey(blank=True, related_name='tickets', null=True, to='issues.Queue')), ], options={ 'ordering': ['-updated_at'], @@ -59,7 +59,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name='TicketTracker', fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)), + ('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')), ('ticket', models.ForeignKey(related_name='trackers', to='issues.Ticket', verbose_name='ticket')), ('user', models.ForeignKey(related_name='ticket_trackers', to=settings.AUTH_USER_MODEL, verbose_name='user')), ], diff --git a/orchestra/contrib/lists/migrations/0001_initial.py b/orchestra/contrib/lists/migrations/0001_initial.py index abc72e8c..73497c53 100644 --- a/orchestra/contrib/lists/migrations/0001_initial.py +++ b/orchestra/contrib/lists/migrations/0001_initial.py @@ -2,28 +2,28 @@ from __future__ import unicode_literals from django.db import models, migrations -import orchestra.core.validators from django.conf import settings +import orchestra.core.validators class Migration(migrations.Migration): dependencies = [ - ('domains', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('domains', '0001_initial'), ] operations = [ migrations.CreateModel( name='List', fields=[ - ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), - ('name', models.CharField(verbose_name='name', help_text='Default list address <name>@lists.pangea.org', validators=[orchestra.core.validators.validate_name], max_length=128, unique=True)), - ('address_name', models.CharField(verbose_name='address name', blank=True, validators=[orchestra.core.validators.validate_name], max_length=128)), - ('admin_email', models.EmailField(verbose_name='admin email', help_text='Administration email address', max_length=254)), - ('is_active', models.BooleanField(verbose_name='active', help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.', default=True)), - ('account', models.ForeignKey(verbose_name='Account', related_name='lists', to=settings.AUTH_USER_MODEL)), - ('address_domain', models.ForeignKey(verbose_name='address domain', null=True, blank=True, to='domains.Domain')), + ('id', models.AutoField(auto_created=True, verbose_name='ID', serialize=False, primary_key=True)), + ('name', models.CharField(max_length=128, validators=[orchestra.core.validators.validate_name], unique=True, verbose_name='name', help_text='Default list address <name>@lists.orchestra.lan')), + ('address_name', models.CharField(max_length=128, validators=[orchestra.core.validators.validate_name], verbose_name='address name', blank=True)), + ('admin_email', models.EmailField(max_length=254, verbose_name='admin email', help_text='Administration email address')), + ('is_active', models.BooleanField(default=True, verbose_name='active', help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.')), + ('account', models.ForeignKey(related_name='lists', to=settings.AUTH_USER_MODEL, verbose_name='Account')), + ('address_domain', models.ForeignKey(null=True, blank=True, to='domains.Domain', verbose_name='address domain')), ], ), migrations.AlterUniqueTogether( diff --git a/orchestra/contrib/mailboxes/migrations/0001_initial.py b/orchestra/contrib/mailboxes/migrations/0001_initial.py index ae3e7b65..93dcc5fc 100644 --- a/orchestra/contrib/mailboxes/migrations/0001_initial.py +++ b/orchestra/contrib/mailboxes/migrations/0001_initial.py @@ -19,10 +19,10 @@ class Migration(migrations.Migration): name='Address', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(help_text='Address name, left blank for a catch-all address', validators=[orchestra.contrib.mailboxes.validators.validate_emailname], verbose_name='name', blank=True, max_length=64)), - ('forward', models.CharField(help_text='Space separated email addresses or mailboxes', validators=[orchestra.contrib.mailboxes.validators.validate_forward], verbose_name='forward', blank=True, max_length=256)), - ('account', models.ForeignKey(related_name='addresses', to=settings.AUTH_USER_MODEL, verbose_name='Account')), - ('domain', models.ForeignKey(related_name='addresses', to='domains.Domain', verbose_name='domain')), + ('name', models.CharField(verbose_name='name', validators=[orchestra.contrib.mailboxes.validators.validate_emailname], blank=True, help_text='Address name, left blank for a catch-all address', max_length=64)), + ('forward', models.CharField(verbose_name='forward', validators=[orchestra.contrib.mailboxes.validators.validate_forward], blank=True, help_text='Space separated email addresses or mailboxes', max_length=256)), + ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='addresses', verbose_name='Account')), + ('domain', models.ForeignKey(to='domains.Domain', related_name='addresses', verbose_name='domain')), ], options={ 'verbose_name_plural': 'addresses', @@ -34,20 +34,20 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('subject', models.CharField(verbose_name='subject', max_length=256)), ('message', models.TextField(verbose_name='message')), - ('enabled', models.BooleanField(default=False, verbose_name='enabled')), - ('address', models.OneToOneField(related_name='autoresponse', to='mailboxes.Address', verbose_name='address')), + ('enabled', models.BooleanField(verbose_name='enabled', default=False)), + ('address', models.OneToOneField(to='mailboxes.Address', related_name='autoresponse', verbose_name='address')), ], ), migrations.CreateModel( name='Mailbox', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(unique=True, help_text='Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.', validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid mailbox name.')], verbose_name='name', max_length=64)), + ('name', models.CharField(verbose_name='name', validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid mailbox name.')], help_text='Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=64, unique=True)), ('password', models.CharField(verbose_name='password', max_length=128)), - ('filtering', models.CharField(choices=[('REJECT', 'Reject spam (X-Spam-Score≥9)'), ('REDIRECT', 'Archive spam (X-Spam-Score≥9)'), ('DISABLE', 'Disable'), ('CUSTOM', 'Custom filtering')], default='REDIRECT', max_length=16)), - ('custom_filtering', models.TextField(help_text='Arbitrary email filtering in sieve language. This overrides any automatic junk email filtering', validators=[orchestra.contrib.mailboxes.validators.validate_sieve], verbose_name='filtering', blank=True)), - ('is_active', models.BooleanField(default=True, verbose_name='active')), - ('account', models.ForeignKey(related_name='mailboxes', to=settings.AUTH_USER_MODEL, verbose_name='account')), + ('filtering', models.CharField(choices=[('CUSTOM', 'Custom filtering'), ('REDIRECT', 'Archive spam (X-Spam-Score≥9)'), ('DISABLE', 'Disable'), ('REJECT', 'Reject spam (X-Spam-Score≥9)')], max_length=16, default='REDIRECT')), + ('custom_filtering', models.TextField(verbose_name='filtering', validators=[orchestra.contrib.mailboxes.validators.validate_sieve], blank=True, help_text='Arbitrary email filtering in sieve language. This overrides any automatic junk email filtering')), + ('is_active', models.BooleanField(verbose_name='active', default=True)), + ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='mailboxes', verbose_name='account')), ], options={ 'verbose_name_plural': 'mailboxes', @@ -56,7 +56,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='address', name='mailboxes', - field=models.ManyToManyField(related_name='addresses', to='mailboxes.Mailbox', verbose_name='mailboxes', blank=True), + field=models.ManyToManyField(verbose_name='mailboxes', to='mailboxes.Mailbox', blank=True, related_name='addresses'), ), migrations.AlterUniqueTogether( name='address', diff --git a/orchestra/contrib/miscellaneous/migrations/0001_initial.py b/orchestra/contrib/miscellaneous/migrations/0001_initial.py index 60bef968..57f112e2 100644 --- a/orchestra/contrib/miscellaneous/migrations/0001_initial.py +++ b/orchestra/contrib/miscellaneous/migrations/0001_initial.py @@ -2,9 +2,9 @@ from __future__ import unicode_literals from django.db import models, migrations -import orchestra.models.fields import orchestra.core.validators from django.conf import settings +import orchestra.models.fields class Migration(migrations.Migration): @@ -17,12 +17,12 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Miscellaneous', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('identifier', orchestra.models.fields.NullableCharField(null=True, verbose_name='identifier', unique=True, help_text='A unique identifier for this service.', max_length=256)), - ('description', models.TextField(verbose_name='description', blank=True)), - ('amount', models.PositiveIntegerField(verbose_name='amount', default=1)), - ('is_active', models.BooleanField(help_text='Designates whether this service should be treated as active. Unselect this instead of deleting services.', verbose_name='active', default=True)), - ('account', models.ForeignKey(verbose_name='account', to=settings.AUTH_USER_MODEL, related_name='miscellaneous')), + ('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)), + ('identifier', orchestra.models.fields.NullableCharField(max_length=256, help_text='A unique identifier for this service.', unique=True, null=True, verbose_name='identifier')), + ('description', models.TextField(blank=True, verbose_name='description')), + ('amount', models.PositiveIntegerField(default=1, verbose_name='amount')), + ('is_active', models.BooleanField(default=True, help_text='Designates whether this service should be treated as active. Unselect this instead of deleting services.', verbose_name='active')), + ('account', models.ForeignKey(related_name='miscellaneous', verbose_name='account', to=settings.AUTH_USER_MODEL)), ], options={ 'verbose_name_plural': 'miscellaneous', @@ -31,18 +31,18 @@ class Migration(migrations.Migration): migrations.CreateModel( name='MiscService', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('name', models.CharField(verbose_name='name', unique=True, validators=[orchestra.core.validators.validate_name], max_length=32, help_text='Raw name used for internal referenciation, i.e. service match definition')), - ('verbose_name', models.CharField(verbose_name='verbose name', max_length=256, blank=True, help_text='Human readable name')), - ('description', models.TextField(verbose_name='description', blank=True, help_text='Optional description')), - ('has_identifier', models.BooleanField(help_text='Designates if this service has a unique text field that identifies it or not.', verbose_name='has identifier', default=True)), - ('has_amount', models.BooleanField(help_text='Designates whether this service has amount property or not.', verbose_name='has amount', default=False)), - ('is_active', models.BooleanField(help_text='Whether new instances of this service can be created or not. Unselect this instead of deleting services.', verbose_name='active', default=True)), + ('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)), + ('name', models.CharField(max_length=32, help_text='Raw name used for internal referenciation, i.e. service match definition', unique=True, verbose_name='name', validators=[orchestra.core.validators.validate_name])), + ('verbose_name', models.CharField(max_length=256, help_text='Human readable name', blank=True, verbose_name='verbose name')), + ('description', models.TextField(help_text='Optional description', blank=True, verbose_name='description')), + ('has_identifier', models.BooleanField(default=True, help_text='Designates if this service has a unique text field that identifies it or not.', verbose_name='has identifier')), + ('has_amount', models.BooleanField(default=False, help_text='Designates whether this service has amount property or not.', verbose_name='has amount')), + ('is_active', models.BooleanField(default=True, help_text='Whether new instances of this service can be created or not. Unselect this instead of deleting services.', verbose_name='active')), ], ), migrations.AddField( model_name='miscellaneous', name='service', - field=models.ForeignKey(verbose_name='service', to='miscellaneous.MiscService', related_name='instances'), + field=models.ForeignKey(related_name='instances', verbose_name='service', to='miscellaneous.MiscService'), ), ] diff --git a/orchestra/contrib/orchestration/migrations/0001_initial.py b/orchestra/contrib/orchestration/migrations/0001_initial.py index 2e24cc81..b36fed2a 100644 --- a/orchestra/contrib/orchestration/migrations/0001_initial.py +++ b/orchestra/contrib/orchestration/migrations/0001_initial.py @@ -15,15 +15,15 @@ class Migration(migrations.Migration): migrations.CreateModel( name='BackendLog', fields=[ - ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)), ('backend', models.CharField(max_length=256, verbose_name='backend')), - ('state', models.CharField(choices=[('RECEIVED', 'RECEIVED'), ('TIMEOUT', 'TIMEOUT'), ('STARTED', 'STARTED'), ('SUCCESS', 'SUCCESS'), ('FAILURE', 'FAILURE'), ('ERROR', 'ERROR'), ('ABORTED', 'ABORTED'), ('REVOKED', 'REVOKED')], max_length=16, default='RECEIVED', verbose_name='state')), + ('state', models.CharField(choices=[('RECEIVED', 'RECEIVED'), ('TIMEOUT', 'TIMEOUT'), ('STARTED', 'STARTED'), ('SUCCESS', 'SUCCESS'), ('FAILURE', 'FAILURE'), ('ERROR', 'ERROR'), ('ABORTED', 'ABORTED'), ('REVOKED', 'REVOKED')], default='RECEIVED', max_length=16, verbose_name='state')), ('script', models.TextField(verbose_name='script')), ('stdout', models.TextField(verbose_name='stdout')), ('stderr', models.TextField(verbose_name='stdin')), ('traceback', models.TextField(verbose_name='traceback')), - ('exit_code', models.IntegerField(null=True, verbose_name='exit code')), - ('task_id', models.CharField(null=True, max_length=36, help_text='Celery task ID when used as execution backend', unique=True, verbose_name='task ID')), + ('exit_code', models.IntegerField(verbose_name='exit code', null=True)), + ('task_id', models.CharField(help_text='Celery task ID when used as execution backend', verbose_name='task ID', unique=True, max_length=36, null=True)), ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created')), ('updated_at', models.DateTimeField(auto_now=True, verbose_name='updated')), ], @@ -34,12 +34,12 @@ class Migration(migrations.Migration): migrations.CreateModel( name='BackendOperation', fields=[ - ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)), ('backend', models.CharField(max_length=256, verbose_name='backend')), ('action', models.CharField(max_length=64, verbose_name='action')), ('object_id', models.PositiveIntegerField()), ('content_type', models.ForeignKey(to='contenttypes.ContentType')), - ('log', models.ForeignKey(to='orchestration.BackendLog', related_name='operations')), + ('log', models.ForeignKey(related_name='operations', to='orchestration.BackendLog')), ], options={ 'verbose_name_plural': 'Operations', @@ -49,20 +49,20 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Route', fields=[ - ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')), - ('backend', models.CharField(choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic'), ('Apache2Backend', '[S] Apache 2'), ('BSCWBackend', '[S] BSCW SaaS'), ('Bind9MasterDomainBackend', '[S] Bind9 master domain'), ('Bind9SlaveDomainBackend', '[S] Bind9 slave domain'), ('DokuWikiMuBackend', '[S] DokuWiki multisite'), ('DovecotPostfixPasswdVirtualUserBackend', '[S] Dovecot-Postfix virtualuser'), ('DrupalMuBackend', '[S] Drupal multisite'), ('GitLabSaaSBackend', '[S] GitLab SaaS'), ('AutoresponseBackend', '[S] Mail autoresponse'), ('MailmanBackend', '[S] Mailman'), ('MySQLBackend', '[S] MySQL database'), ('MySQLUserBackend', '[S] MySQL user'), ('PHPBackend', '[S] PHP FPM/FCGID'), ('PostfixAddressBackend', '[S] Postfix address'), ('uWSGIPythonBackend', '[S] Python uWSGI'), ('StaticBackend', '[S] Static'), ('SymbolicLinkBackend', '[S] Symbolic link webapp'), ('SyncBind9MasterDomainBackend', '[S] Sync Bind9 master domain'), ('SyncBind9SlaveDomainBackend', '[S] Sync Bind9 slave domain'), ('UNIXUserMaildirBackend', '[S] UNIX maildir user'), ('UNIXUserBackend', '[S] UNIX user'), ('WebalizerAppBackend', '[S] Webalizer App'), ('WebalizerBackend', '[S] Webalizer Content'), ('WordPressBackend', '[S] Wordpress'), ('WordpressMuBackend', '[S] Wordpress multisite'), ('PhpListSaaSBackend', '[S] phpList SaaS')], max_length=256, verbose_name='backend')), - ('match', models.CharField(max_length=256, default='True', blank=True, help_text='Python expression used for selecting the targe host, instance referes to the current object.', verbose_name='match')), + ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)), + ('backend', models.CharField(choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic'), ('Apache2Backend', '[S] Apache 2'), ('BSCWBackend', '[S] BSCW SaaS'), ('Bind9MasterDomainBackend', '[S] Bind9 master domain'), ('Bind9SlaveDomainBackend', '[S] Bind9 slave domain'), ('DokuWikiMuBackend', '[S] DokuWiki multisite'), ('DovecotPostfixPasswdVirtualUserBackend', '[S] Dovecot-Postfix virtualuser'), ('DrupalMuBackend', '[S] Drupal multisite'), ('GitLabSaaSBackend', '[S] GitLab SaaS'), ('AutoresponseBackend', '[S] Mail autoresponse'), ('MailmanBackend', '[S] Mailman'), ('MySQLBackend', '[S] MySQL database'), ('MySQLUserBackend', '[S] MySQL user'), ('PHPBackend', '[S] PHP FPM/FCGID'), ('PostfixAddressBackend', '[S] Postfix address'), ('uWSGIPythonBackend', '[S] Python uWSGI'), ('StaticBackend', '[S] Static'), ('SymbolicLinkBackend', '[S] Symbolic link webapp'), ('UNIXUserMaildirBackend', '[S] UNIX maildir user'), ('UNIXUserBackend', '[S] UNIX user'), ('WebalizerAppBackend', '[S] Webalizer App'), ('WebalizerBackend', '[S] Webalizer Content'), ('WordPressBackend', '[S] Wordpress'), ('WordpressMuBackend', '[S] Wordpress multisite'), ('PhpListSaaSBackend', '[S] phpList SaaS')], max_length=256, verbose_name='backend')), + ('match', models.CharField(help_text='Python expression used for selecting the targe host, instance referes to the current object.', default='True', blank=True, max_length=256, verbose_name='match')), ('is_active', models.BooleanField(default=True, verbose_name='active')), ], ), migrations.CreateModel( name='Server', fields=[ - ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=256, unique=True, verbose_name='name')), - ('address', orchestra.models.fields.NullableCharField(null=True, help_text='IP address or domain name', verbose_name='address', max_length=256, unique=True, blank=True)), + ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)), + ('name', models.CharField(unique=True, max_length=256, verbose_name='name')), + ('address', orchestra.models.fields.NullableCharField(blank=True, max_length=256, null=True, help_text='IP address or domain name', unique=True, verbose_name='address')), ('description', models.TextField(blank=True, verbose_name='description')), - ('os', models.CharField(choices=[('LINUX', 'Linux')], max_length=32, default='LINUX', verbose_name='operative system')), + ('os', models.CharField(choices=[('LINUX', 'Linux')], default='LINUX', max_length=32, verbose_name='operative system')), ], ), migrations.AddField( @@ -73,7 +73,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='backendlog', name='server', - field=models.ForeignKey(verbose_name='server', related_name='execution_logs', to='orchestration.Server'), + field=models.ForeignKey(related_name='execution_logs', to='orchestration.Server', verbose_name='server'), ), migrations.AlterUniqueTogether( name='route', diff --git a/orchestra/contrib/orders/migrations/0001_initial.py b/orchestra/contrib/orders/migrations/0001_initial.py index 06634d80..7d4f9173 100644 --- a/orchestra/contrib/orders/migrations/0001_initial.py +++ b/orchestra/contrib/orders/migrations/0001_initial.py @@ -2,24 +2,24 @@ from __future__ import unicode_literals from django.db import models, migrations -from django.conf import settings import django.utils.timezone +from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('contenttypes', '0002_remove_content_type_name'), ('services', '__first__'), + ('contenttypes', '0002_remove_content_type_name'), ] operations = [ migrations.CreateModel( name='MetricStorage', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)), - ('value', models.DecimalField(max_digits=16, decimal_places=2, verbose_name='value')), + ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)), + ('value', models.DecimalField(decimal_places=2, max_digits=16, verbose_name='value')), ('created_on', models.DateField(auto_now_add=True, verbose_name='created')), ('updated_on', models.DateTimeField(verbose_name='updated')), ], @@ -30,17 +30,17 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Order', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)), + ('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)), ('object_id', models.PositiveIntegerField(null=True)), ('registered_on', models.DateField(default=django.utils.timezone.now, verbose_name='registered')), - ('cancelled_on', models.DateField(blank=True, null=True, verbose_name='cancelled')), - ('billed_on', models.DateField(blank=True, null=True, verbose_name='billed')), - ('billed_until', models.DateField(blank=True, null=True, verbose_name='billed until')), + ('cancelled_on', models.DateField(blank=True, verbose_name='cancelled', null=True)), + ('billed_on', models.DateField(blank=True, verbose_name='billed', null=True)), + ('billed_until', models.DateField(blank=True, verbose_name='billed until', null=True)), ('ignore', models.BooleanField(default=False, verbose_name='ignore')), ('description', models.TextField(blank=True, verbose_name='description')), - ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='orders', verbose_name='account')), + ('account', models.ForeignKey(verbose_name='account', related_name='orders', to=settings.AUTH_USER_MODEL)), ('content_type', models.ForeignKey(to='contenttypes.ContentType')), - ('service', models.ForeignKey(to='services.Service', related_name='orders', verbose_name='service')), + ('service', models.ForeignKey(verbose_name='service', related_name='orders', to='services.Service')), ], options={ 'get_latest_by': 'id', @@ -49,6 +49,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name='metricstorage', name='order', - field=models.ForeignKey(to='orders.Order', related_name='metrics', verbose_name='order'), + field=models.ForeignKey(verbose_name='order', related_name='metrics', to='orders.Order'), ), ] diff --git a/orchestra/contrib/payments/migrations/0001_initial.py b/orchestra/contrib/payments/migrations/0001_initial.py index fa467586..dce1ac84 100644 --- a/orchestra/contrib/payments/migrations/0001_initial.py +++ b/orchestra/contrib/payments/migrations/0001_initial.py @@ -10,39 +10,39 @@ class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('bills', '0002_auto_20150429_1343'), + ('bills', '0002_auto_20150429_1417'), ] operations = [ migrations.CreateModel( name='PaymentSource', fields=[ - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), - ('method', models.CharField(verbose_name='method', choices=[('SEPADirectDebit', 'SEPA Direct Debit')], max_length=32)), + ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), + ('method', models.CharField(choices=[('CreditCard', 'Credit card'), ('SEPADirectDebit', 'SEPA Direct Debit')], verbose_name='method', max_length=32)), ('data', jsonfield.fields.JSONField(verbose_name='data', default={})), ('is_active', models.BooleanField(verbose_name='active', default=True)), - ('account', models.ForeignKey(related_name='paymentsources', verbose_name='account', to=settings.AUTH_USER_MODEL)), + ('account', models.ForeignKey(verbose_name='account', related_name='paymentsources', to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='Transaction', fields=[ - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), - ('state', models.CharField(verbose_name='state', choices=[('WAITTING_PROCESSING', 'Waitting processing'), ('WAITTING_EXECUTION', 'Waitting execution'), ('EXECUTED', 'Executed'), ('SECURED', 'Secured'), ('REJECTED', 'Rejected')], max_length=32, default='WAITTING_PROCESSING')), - ('amount', models.DecimalField(verbose_name='amount', max_digits=12, decimal_places=2)), + ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), + ('state', models.CharField(choices=[('WAITTING_PROCESSING', 'Waitting processing'), ('WAITTING_EXECUTION', 'Waitting execution'), ('EXECUTED', 'Executed'), ('SECURED', 'Secured'), ('REJECTED', 'Rejected')], verbose_name='state', max_length=32, default='WAITTING_PROCESSING')), + ('amount', models.DecimalField(verbose_name='amount', decimal_places=2, max_digits=12)), ('currency', models.CharField(max_length=10, default='Eur')), ('created_at', models.DateTimeField(verbose_name='created', auto_now_add=True)), ('modified_at', models.DateTimeField(verbose_name='modified', auto_now=True)), - ('bill', models.ForeignKey(related_name='transactions', verbose_name='bill', to='bills.Bill')), + ('bill', models.ForeignKey(verbose_name='bill', related_name='transactions', to='bills.Bill')), ], ), migrations.CreateModel( name='TransactionProcess', fields=[ - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), - ('data', jsonfield.fields.JSONField(verbose_name='data', blank=True)), - ('file', models.FileField(verbose_name='file', blank=True, upload_to='')), - ('state', models.CharField(verbose_name='state', choices=[('CREATED', 'Created'), ('EXECUTED', 'Executed'), ('ABORTED', 'Aborted'), ('COMMITED', 'Commited')], max_length=16, default='CREATED')), + ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), + ('data', jsonfield.fields.JSONField(blank=True, verbose_name='data')), + ('file', models.FileField(blank=True, upload_to='', verbose_name='file')), + ('state', models.CharField(choices=[('CREATED', 'Created'), ('EXECUTED', 'Executed'), ('ABORTED', 'Aborted'), ('COMMITED', 'Commited')], verbose_name='state', max_length=16, default='CREATED')), ('created_at', models.DateTimeField(verbose_name='created', auto_now_add=True)), ('updated_at', models.DateTimeField(verbose_name='updated', auto_now=True)), ], @@ -53,11 +53,11 @@ class Migration(migrations.Migration): migrations.AddField( model_name='transaction', name='process', - field=models.ForeignKey(related_name='transactions', blank=True, null=True, verbose_name='process', to='payments.TransactionProcess'), + field=models.ForeignKey(verbose_name='process', null=True, blank=True, related_name='transactions', to='payments.TransactionProcess'), ), migrations.AddField( model_name='transaction', name='source', - field=models.ForeignKey(related_name='transactions', blank=True, null=True, verbose_name='source', to='payments.PaymentSource'), + field=models.ForeignKey(verbose_name='source', null=True, blank=True, related_name='transactions', to='payments.PaymentSource'), ), ] diff --git a/orchestra/contrib/plans/migrations/0001_initial.py b/orchestra/contrib/plans/migrations/0001_initial.py index a70c97c2..f7ec2ba2 100644 --- a/orchestra/contrib/plans/migrations/0001_initial.py +++ b/orchestra/contrib/plans/migrations/0001_initial.py @@ -2,14 +2,14 @@ from __future__ import unicode_literals from django.db import models, migrations -from django.conf import settings import orchestra.core.validators +from django.conf import settings class Migration(migrations.Migration): dependencies = [ - ('services', '__first__'), + ('services', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] @@ -17,8 +17,8 @@ class Migration(migrations.Migration): migrations.CreateModel( name='ContractedPlan', fields=[ - ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')), - ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='account', related_name='plans')), + ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')), + ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='plans', verbose_name='account')), ], options={ 'verbose_name_plural': 'plans', @@ -27,29 +27,29 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Plan', fields=[ - ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')), - ('name', models.CharField(validators=[orchestra.core.validators.validate_name], unique=True, max_length=32, verbose_name='name')), - ('verbose_name', models.CharField(max_length=128, verbose_name='verbose_name', blank=True)), - ('is_active', models.BooleanField(default=True, help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), - ('is_default', models.BooleanField(default=False, help_text='Designates whether this plan is used by default or not.', verbose_name='default')), - ('is_combinable', models.BooleanField(default=True, help_text='Designates whether this plan can be combined with other plans or not.', verbose_name='combinable')), - ('allow_multiple', models.BooleanField(default=False, help_text='Designates whether this plan allow for multiple contractions.', verbose_name='allow multiple')), + ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(validators=[orchestra.core.validators.validate_name], verbose_name='name', unique=True, max_length=32)), + ('verbose_name', models.CharField(blank=True, verbose_name='verbose_name', max_length=128)), + ('is_active', models.BooleanField(help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active', default=True)), + ('is_default', models.BooleanField(help_text='Designates whether this plan is used by default or not.', verbose_name='default', default=False)), + ('is_combinable', models.BooleanField(help_text='Designates whether this plan can be combined with other plans or not.', verbose_name='combinable', default=True)), + ('allow_multiple', models.BooleanField(help_text='Designates whether this plan allow for multiple contractions.', verbose_name='allow multiple', default=False)), ], ), migrations.CreateModel( name='Rate', fields=[ - ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')), - ('quantity', models.PositiveIntegerField(null=True, help_text='See rate algorihm help text.', verbose_name='quantity', blank=True)), - ('price', models.DecimalField(max_digits=12, verbose_name='price', decimal_places=2)), - ('plan', models.ForeignKey(to='plans.Plan', verbose_name='plan', related_name='rates')), - ('service', models.ForeignKey(to='services.Service', verbose_name='service', related_name='rates')), + ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')), + ('quantity', models.PositiveIntegerField(help_text='See rate algorihm help text.', blank=True, verbose_name='quantity', null=True)), + ('price', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='price')), + ('plan', models.ForeignKey(to='plans.Plan', related_name='rates', verbose_name='plan')), + ('service', models.ForeignKey(to='services.Service', related_name='rates', verbose_name='service')), ], ), migrations.AddField( model_name='contractedplan', name='plan', - field=models.ForeignKey(to='plans.Plan', verbose_name='plan', related_name='contracts'), + field=models.ForeignKey(to='plans.Plan', related_name='contracts', verbose_name='plan'), ), migrations.AlterUniqueTogether( name='rate', diff --git a/orchestra/contrib/resources/migrations/0001_initial.py b/orchestra/contrib/resources/migrations/0001_initial.py index 7df024e6..2496191e 100644 --- a/orchestra/contrib/resources/migrations/0001_initial.py +++ b/orchestra/contrib/resources/migrations/0001_initial.py @@ -2,62 +2,62 @@ from __future__ import unicode_literals from django.db import models, migrations -import django.utils.timezone import orchestra.contrib.resources.validators import orchestra.models.fields +import django.utils.timezone import orchestra.core.validators class Migration(migrations.Migration): dependencies = [ - ('contenttypes', '0002_remove_content_type_name'), ('djcelery', '__first__'), + ('contenttypes', '0002_remove_content_type_name'), ] operations = [ migrations.CreateModel( name='MonitorData', fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('monitor', models.CharField(max_length=256, choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic')], verbose_name='monitor')), + ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')), + ('monitor', models.CharField(choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic')], max_length=256, verbose_name='monitor')), ('object_id', models.PositiveIntegerField(verbose_name='object id')), ('created_at', models.DateTimeField(default=django.utils.timezone.now, verbose_name='created')), - ('value', models.DecimalField(max_digits=16, decimal_places=2, verbose_name='value')), - ('content_type', models.ForeignKey(to='contenttypes.ContentType', verbose_name='content type')), + ('value', models.DecimalField(decimal_places=2, max_digits=16, verbose_name='value')), + ('content_type', models.ForeignKey(verbose_name='content type', to='contenttypes.ContentType')), ], options={ - 'verbose_name_plural': 'monitor data', 'get_latest_by': 'id', + 'verbose_name_plural': 'monitor data', }, ), migrations.CreateModel( name='Resource', fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(validators=[orchestra.core.validators.validate_name], max_length=32, help_text='Required. 32 characters or fewer. Lowercase letters, digits and hyphen only.', verbose_name='name')), + ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(validators=[orchestra.core.validators.validate_name], help_text='Required. 32 characters or fewer. Lowercase letters, digits and hyphen only.', max_length=32, verbose_name='name')), ('verbose_name', models.CharField(max_length=256, verbose_name='verbose name')), - ('aggregation', models.CharField(max_length=16, help_text='Method used for aggregating this resource monitored data.', choices=[('last-10-days-avg', 'Last 10 days AVG'), ('last', 'Last value'), ('monthly-avg', 'Monthly AVG'), ('monthly-sum', 'Monthly Sum')], default='last-10-days-avg', verbose_name='aggregation')), + ('aggregation', models.CharField(choices=[('last-10-days-avg', 'Last 10 days AVG'), ('last', 'Last value'), ('monthly-avg', 'Monthly AVG'), ('monthly-sum', 'Monthly Sum')], help_text='Method used for aggregating this resource monitored data.', max_length=16, default='last-10-days-avg', verbose_name='aggregation')), ('on_demand', models.BooleanField(help_text='If enabled the resource will not be pre-allocated, but allocated under the application demand', default=False, verbose_name='on demand')), ('default_allocation', models.PositiveIntegerField(help_text='Default allocation value used when this is not an on demand resource', blank=True, null=True, verbose_name='default allocation')), - ('unit', models.CharField(max_length=16, help_text='The unit in which this resource is represented. For example GB, KB or subscribers', verbose_name='unit')), - ('scale', models.CharField(validators=[orchestra.contrib.resources.validators.validate_scale], max_length=32, help_text='Scale in which this resource monitoring resoults should be prorcessed to match with unit. e.g. 10**9', verbose_name='scale')), + ('unit', models.CharField(help_text='The unit in which this resource is represented. For example GB, KB or subscribers', max_length=16, verbose_name='unit')), + ('scale', models.CharField(validators=[orchestra.contrib.resources.validators.validate_scale], help_text='Scale in which this resource monitoring resoults should be prorcessed to match with unit. e.g. 10**9', max_length=32, verbose_name='scale')), ('disable_trigger', models.BooleanField(help_text='Disables monitors exeeded and recovery triggers', default=False, verbose_name='disable trigger')), - ('monitors', orchestra.models.fields.MultiSelectField(max_length=256, help_text='Monitor backends used for monitoring this resource.', blank=True, choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic')], verbose_name='monitors')), + ('monitors', orchestra.models.fields.MultiSelectField(choices=[('Apache2Traffic', '[M] Apache 2 Traffic'), ('DovecotMaildirDisk', '[M] Dovecot Maildir size'), ('Exim4Traffic', '[M] Exim4 traffic'), ('MailmanSubscribers', '[M] Mailman subscribers'), ('MailmanTraffic', '[M] Mailman traffic'), ('MysqlDisk', '[M] MySQL disk'), ('OpenVZTraffic', '[M] OpenVZTraffic'), ('PostfixMailscannerTraffic', '[M] Postfix-Mailscanner traffic'), ('UNIXUserDisk', '[M] UNIX user disk'), ('VsFTPdTraffic', '[M] VsFTPd traffic')], blank=True, help_text='Monitor backends used for monitoring this resource.', max_length=256, verbose_name='monitors')), ('is_active', models.BooleanField(default=True, verbose_name='active')), - ('content_type', models.ForeignKey(to='contenttypes.ContentType', help_text='Model where this resource will be hooked.')), - ('crontab', models.ForeignKey(null=True, verbose_name='crontab', to='djcelery.CrontabSchedule', help_text='Crontab for periodic execution. Leave it empty to disable periodic monitoring', blank=True)), + ('content_type', models.ForeignKey(help_text='Model where this resource will be hooked.', to='contenttypes.ContentType')), + ('crontab', models.ForeignKey(help_text='Crontab for periodic execution. Leave it empty to disable periodic monitoring', to='djcelery.CrontabSchedule', verbose_name='crontab', blank=True, null=True)), ], ), migrations.CreateModel( name='ResourceData', fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')), ('object_id', models.PositiveIntegerField(verbose_name='object id')), - ('used', models.DecimalField(max_digits=16, editable=False, decimal_places=3, null=True, verbose_name='used')), + ('used', models.DecimalField(decimal_places=3, editable=False, max_digits=16, null=True, verbose_name='used')), ('updated_at', models.DateTimeField(editable=False, null=True, verbose_name='updated')), - ('allocated', models.DecimalField(max_digits=8, blank=True, decimal_places=2, null=True, verbose_name='allocated')), - ('content_type', models.ForeignKey(to='contenttypes.ContentType', verbose_name='content type')), + ('allocated', models.DecimalField(decimal_places=2, max_digits=8, blank=True, null=True, verbose_name='allocated')), + ('content_type', models.ForeignKey(verbose_name='content type', to='contenttypes.ContentType')), ('resource', models.ForeignKey(related_name='dataset', to='resources.Resource', verbose_name='resource')), ], options={ diff --git a/orchestra/contrib/saas/migrations/0001_initial.py b/orchestra/contrib/saas/migrations/0001_initial.py index 0d542338..5ed402ed 100644 --- a/orchestra/contrib/saas/migrations/0001_initial.py +++ b/orchestra/contrib/saas/migrations/0001_initial.py @@ -18,17 +18,17 @@ class Migration(migrations.Migration): migrations.CreateModel( name='SaaS', fields=[ - ('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)), + ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), ('service', models.CharField(max_length=32, verbose_name='service', choices=[('bscw', 'BSCW'), ('DokuWikiService', 'Dowkuwiki'), ('DrupalService', 'Drupal'), ('gitlab', 'GitLab'), ('MoodleService', 'Moodle'), ('seafile', 'SeaFile'), ('WordPressService', 'WordPress'), ('phplist', 'phpList')])), - ('name', models.CharField(help_text='Required. 64 characters or fewer. Letters, digits and ./-/_ only.', max_length=64, verbose_name='Name', validators=[orchestra.core.validators.validate_username])), + ('name', models.CharField(max_length=64, validators=[orchestra.core.validators.validate_username], verbose_name='Name', help_text='Required. 64 characters or fewer. Letters, digits and ./-/_ only.')), ('is_active', models.BooleanField(help_text='Designates whether this service should be treated as active. ', verbose_name='active', default=True)), ('data', jsonfield.fields.JSONField(help_text='Extra information dependent of each service.', verbose_name='data', default={})), ('account', models.ForeignKey(verbose_name='account', to=settings.AUTH_USER_MODEL, related_name='saas')), ('database', models.ForeignKey(null=True, blank=True, to='databases.Database')), ], options={ - 'verbose_name': 'SaaS', 'verbose_name_plural': 'SaaS', + 'verbose_name': 'SaaS', }, ), migrations.AlterUniqueTogether( diff --git a/orchestra/contrib/services/migrations/0001_initial.py b/orchestra/contrib/services/migrations/0001_initial.py index d2978000..f376f4e3 100644 --- a/orchestra/contrib/services/migrations/0001_initial.py +++ b/orchestra/contrib/services/migrations/0001_initial.py @@ -14,25 +14,25 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Service', fields=[ - ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')), - ('description', models.CharField(unique=True, max_length=256, verbose_name='description')), - ('match', models.CharField(max_length=256, blank=True, help_text="Python expression that designates wheter a content_type object is related to this service or not, always evaluates True when left blank. Related instance can be instantiated with instance keyword or content_type.model_name.
 databaseuser.type == 'MYSQL'
 miscellaneous.active and str(miscellaneous.identifier).endswith(('.org', '.net', '.com'))
 contractedplan.plan.name == 'association_fee''
 instance.active", verbose_name='match')), - ('handler_type', models.CharField(max_length=256, blank=True, help_text='Handler used for processing this Service. A handler enables customized behaviour far beyond what options here allow to.', verbose_name='handler', choices=[('', 'Default')])), + ('id', models.AutoField(primary_key=True, auto_created=True, verbose_name='ID', serialize=False)), + ('description', models.CharField(verbose_name='description', max_length=256, unique=True)), + ('match', models.CharField(blank=True, help_text="Python expression that designates wheter a content_type object is related to this service or not, always evaluates True when left blank. Related instance can be instantiated with instance keyword or content_type.model_name.
 databaseuser.type == 'MYSQL'
 miscellaneous.active and str(miscellaneous.identifier).endswith(('.org', '.net', '.com'))
 contractedplan.plan.name == 'association_fee''
 instance.active", max_length=256, verbose_name='match')), + ('handler_type', models.CharField(blank=True, help_text='Handler used for processing this Service. A handler enables customized behaviour far beyond what options here allow to.', max_length=256, choices=[('', 'Default')], verbose_name='handler')), ('is_active', models.BooleanField(default=True, verbose_name='active')), - ('ignore_superusers', models.BooleanField(help_text='Designates whether superuser, staff and friend orders are marked as ignored by default or not.', default=True, verbose_name='ignore superuser, staff and friend')), - ('billing_period', models.CharField(max_length=16, verbose_name='billing period', blank=True, help_text='Renewal period for recurring invoicing.', default='ANUAL', choices=[('', 'One time service'), ('MONTHLY', 'Monthly billing'), ('ANUAL', 'Anual billing')])), - ('billing_point', models.CharField(max_length=16, help_text='Reference point for calculating the renewal date on recurring invoices', verbose_name='billing point', default='ON_FIXED_DATE', choices=[('ON_REGISTER', 'Registration date'), ('ON_FIXED_DATE', 'Fixed billing date')])), - ('is_fee', models.BooleanField(help_text='Designates whether this service should be billed as membership fee or not', default=False, verbose_name='fee')), - ('order_description', models.CharField(max_length=128, blank=True, help_text="Python expression used for generating the description for the bill lines of this services.
Defaults to '%s: %s' % (ugettext(handler.description), instance)", verbose_name='Order description')), - ('ignore_period', models.CharField(max_length=16, verbose_name='ignore period', blank=True, help_text='Period in which orders will be ignored if cancelled. Useful for designating trial periods', default='TEN_DAYS', choices=[('', 'Never'), ('ONE_DAY', 'One day'), ('TWO_DAYS', 'Two days'), ('TEN_DAYS', 'Ten days'), ('ONE_MONTH', 'One month')])), - ('metric', models.CharField(max_length=256, blank=True, help_text="Python expression used for obtinging the metric value for the pricing rate computation. Number of orders is used when left blank. Related instance can be instantiated with instance keyword or content_type.model_name.
 max((mailbox.resources.disk.allocated or 0) -1, 0)
 miscellaneous.amount
 max((account.resources.traffic.used or 0) - getattr(account.miscellaneous.filter(is_active=True, service__name='traffic-prepay').last(), 'amount', 0), 0)", verbose_name='metric')), - ('nominal_price', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='nominal price')), - ('tax', models.PositiveIntegerField(verbose_name='tax', default=21, choices=[(0, 'Duty free'), (21, '21%')])), - ('pricing_period', models.CharField(max_length=16, verbose_name='pricing period', blank=True, help_text='Time period that is used for computing the rate metric.', default='BILLING_PERIOD', choices=[('', 'Current value'), ('BILLING_PERIOD', 'Same as billing period'), ('MONTHLY', 'Monthly data'), ('ANUAL', 'Anual data')])), - ('rate_algorithm', models.CharField(max_length=16, help_text='Algorithm used to interprete the rating table.
  Step price: All rates with a quantity lower than the metric are applied. Nominal price will be used when initial block is missing.
  Match price: Only the rate with a) inmediate inferior metric and b) lower price is applied. Nominal price will be used when initial block is missing.', verbose_name='rate algorithm', default='STEP_PRICE', choices=[('STEP_PRICE', 'Step price'), ('MATCH_PRICE', 'Match price')])), - ('on_cancel', models.CharField(max_length=16, help_text='Defines the cancellation behaviour of this service.', verbose_name='on cancel', default='DISCOUNT', choices=[('NOTHING', 'Nothing'), ('DISCOUNT', 'Discount'), ('COMPENSATE', 'Compensat'), ('REFUND', 'Refund')])), - ('payment_style', models.CharField(max_length=16, help_text='Designates whether this service should be paid after consumtion (postpay/on demand) or prepaid.', verbose_name='payment style', default='PREPAY', choices=[('PREPAY', 'Prepay'), ('POSTPAY', 'Postpay (on demand)')])), - ('content_type', models.ForeignKey(to='contenttypes.ContentType', help_text='Content type of the related service objects.', verbose_name='content type')), + ('ignore_superusers', models.BooleanField(default=True, help_text='Designates whether superuser, staff and friend orders are marked as ignored by default or not.', verbose_name='ignore superuser, staff and friend')), + ('billing_period', models.CharField(default='ANUAL', help_text='Renewal period for recurring invoicing.', max_length=16, choices=[('', 'One time service'), ('MONTHLY', 'Monthly billing'), ('ANUAL', 'Anual billing')], blank=True, verbose_name='billing period')), + ('billing_point', models.CharField(default='ON_FIXED_DATE', help_text='Reference point for calculating the renewal date on recurring invoices', max_length=16, choices=[('ON_REGISTER', 'Registration date'), ('ON_FIXED_DATE', 'Fixed billing date')], verbose_name='billing point')), + ('is_fee', models.BooleanField(default=False, help_text='Designates whether this service should be billed as membership fee or not', verbose_name='fee')), + ('order_description', models.CharField(blank=True, help_text="Python expression used for generating the description for the bill lines of this services.
Defaults to '%s: %s' % (ugettext(handler.description), instance)", max_length=128, verbose_name='Order description')), + ('ignore_period', models.CharField(default='TEN_DAYS', help_text='Period in which orders will be ignored if cancelled. Useful for designating trial periods', max_length=16, choices=[('', 'Never'), ('ONE_DAY', 'One day'), ('TWO_DAYS', 'Two days'), ('TEN_DAYS', 'Ten days'), ('ONE_MONTH', 'One month')], blank=True, verbose_name='ignore period')), + ('metric', models.CharField(blank=True, help_text="Python expression used for obtinging the metric value for the pricing rate computation. Number of orders is used when left blank. Related instance can be instantiated with instance keyword or content_type.model_name.
 max((mailbox.resources.disk.allocated or 0) -1, 0)
 miscellaneous.amount
 max((account.resources.traffic.used or 0) - getattr(account.miscellaneous.filter(is_active=True, service__name='traffic-prepay').last(), 'amount', 0), 0)", max_length=256, verbose_name='metric')), + ('nominal_price', models.DecimalField(verbose_name='nominal price', decimal_places=2, max_digits=12)), + ('tax', models.PositiveIntegerField(default=0, verbose_name='tax', choices=[(0, 'Duty free'), (21, '21%')])), + ('pricing_period', models.CharField(default='BILLING_PERIOD', help_text='Time period that is used for computing the rate metric.', max_length=16, choices=[('', 'Current value'), ('BILLING_PERIOD', 'Same as billing period'), ('MONTHLY', 'Monthly data'), ('ANUAL', 'Anual data')], blank=True, verbose_name='pricing period')), + ('rate_algorithm', models.CharField(default='MATCH_PRICE', help_text='Algorithm used to interprete the rating table.
  Match price: Only the rate with a) inmediate inferior metric and b) lower price is applied. Nominal price will be used when initial block is missing.
  Step price: All rates with a quantity lower than the metric are applied. Nominal price will be used when initial block is missing.', max_length=16, choices=[('MATCH_PRICE', 'Match price'), ('STEP_PRICE', 'Step price')], verbose_name='rate algorithm')), + ('on_cancel', models.CharField(default='DISCOUNT', help_text='Defines the cancellation behaviour of this service.', max_length=16, choices=[('NOTHING', 'Nothing'), ('DISCOUNT', 'Discount'), ('COMPENSATE', 'Compensat'), ('REFUND', 'Refund')], verbose_name='on cancel')), + ('payment_style', models.CharField(default='PREPAY', help_text='Designates whether this service should be paid after consumtion (postpay/on demand) or prepaid.', max_length=16, choices=[('PREPAY', 'Prepay'), ('POSTPAY', 'Postpay (on demand)')], verbose_name='payment style')), + ('content_type', models.ForeignKey(help_text='Content type of the related service objects.', to='contenttypes.ContentType', verbose_name='content type')), ], ), ] diff --git a/orchestra/contrib/systemusers/migrations/0001_initial.py b/orchestra/contrib/systemusers/migrations/0001_initial.py index 1caab70f..e15de8e5 100644 --- a/orchestra/contrib/systemusers/migrations/0001_initial.py +++ b/orchestra/contrib/systemusers/migrations/0001_initial.py @@ -2,29 +2,29 @@ from __future__ import unicode_literals from django.db import models, migrations -from django.conf import settings import orchestra.core.validators +from django.conf import settings class Migration(migrations.Migration): dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), +# migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='SystemUser', fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('username', models.CharField(verbose_name='username', help_text='Required. 64 characters or fewer. Letters, digits and ./-/_ only.', validators=[orchestra.core.validators.validate_username], max_length=32, unique=True)), + ('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')), + ('username', models.CharField(validators=[orchestra.core.validators.validate_username], unique=True, help_text='Required. 64 characters or fewer. Letters, digits and ./-/_ only.', max_length=32, verbose_name='username')), ('password', models.CharField(max_length=128, verbose_name='password')), - ('home', models.CharField(verbose_name='home', help_text='Starting location when login with this no-shell user.', blank=True, max_length=256)), - ('directory', models.CharField(verbose_name='directory', help_text="Optional directory relative to user's home.", blank=True, max_length=256)), - ('shell', models.CharField(verbose_name='shell', choices=[('/dev/null', 'No shell, FTP only'), ('/bin/rssh', 'No shell, SFTP/RSYNC only'), ('/bin/bash', '/bin/bash'), ('/bin/sh', '/bin/sh')], default='/dev/null', max_length=32)), - ('is_active', models.BooleanField(verbose_name='active', help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.', default=True)), - ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='systemusers', verbose_name='Account')), - ('groups', models.ManyToManyField(help_text='A new group will be created for the user. Which additional groups would you like them to be a member of?', blank=True, to='systemusers.SystemUser')), + ('home', models.CharField(blank=True, max_length=256, help_text='Starting location when login with this no-shell user.', verbose_name='home')), + ('directory', models.CharField(blank=True, max_length=256, help_text="Optional directory relative to user's home.", verbose_name='directory')), + ('shell', models.CharField(default='/dev/null', max_length=32, choices=[('/dev/null', 'No shell, FTP only'), ('/bin/rssh', 'No shell, SFTP/RSYNC only'), ('/bin/bash', '/bin/bash'), ('/bin/sh', '/bin/sh')], verbose_name='shell')), + ('is_active', models.BooleanField(default=True, help_text='Designates whether this account should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), +# ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='systemusers', verbose_name='Account')), + ('groups', models.ManyToManyField(to='systemusers.SystemUser', blank=True, help_text='A new group will be created for the user. Which additional groups would you like them to be a member of?')), ], ), ] diff --git a/orchestra/contrib/systemusers/migrations/0002_auto_20150429_1413.py b/orchestra/contrib/systemusers/migrations/0002_auto_20150429_1413.py new file mode 100644 index 00000000..d71721e9 --- /dev/null +++ b/orchestra/contrib/systemusers/migrations/0002_auto_20150429_1413.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import orchestra.core.validators +from django.conf import settings + + +class Migration(migrations.Migration): + + dependencies = [ + ('systemusers', '0001_initial'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.AddField( + model_name='systemuser', + name='account', + field=models.ForeignKey(related_name='systemusers', to=settings.AUTH_USER_MODEL, default=1, verbose_name='Account'), + preserve_default=False, + ), + ] + diff --git a/orchestra/contrib/vps/migrations/0001_initial.py b/orchestra/contrib/vps/migrations/0001_initial.py index 031f0849..21a3638f 100644 --- a/orchestra/contrib/vps/migrations/0001_initial.py +++ b/orchestra/contrib/vps/migrations/0001_initial.py @@ -16,16 +16,16 @@ class Migration(migrations.Migration): migrations.CreateModel( name='VPS', fields=[ - ('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)), - ('hostname', models.CharField(unique=True, max_length=256, validators=[orchestra.core.validators.validate_hostname], verbose_name='hostname')), - ('type', models.CharField(max_length=64, choices=[('openvz', 'OpenVZ container')], verbose_name='type', default='openvz')), - ('template', models.CharField(max_length=64, choices=[('debian7', 'Debian 7 - Wheezy')], verbose_name='template', default='debian7')), - ('password', models.CharField(max_length=128, help_text='root password of this virtual machine', verbose_name='password')), - ('account', models.ForeignKey(related_name='vpss', to=settings.AUTH_USER_MODEL, verbose_name='Account')), + ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), + ('hostname', models.CharField(unique=True, verbose_name='hostname', validators=[orchestra.core.validators.validate_hostname], max_length=256)), + ('type', models.CharField(choices=[('openvz', 'OpenVZ container')], verbose_name='type', default='openvz', max_length=64)), + ('template', models.CharField(choices=[('debian7', 'Debian 7 - Wheezy')], verbose_name='template', default='debian7', max_length=64)), + ('password', models.CharField(verbose_name='password', help_text='root password of this virtual machine', max_length=128)), + ('account', models.ForeignKey(verbose_name='Account', related_name='vpss', to=settings.AUTH_USER_MODEL)), ], options={ - 'verbose_name_plural': 'VPSs', 'verbose_name': 'VPS', + 'verbose_name_plural': 'VPSs', }, ), ] diff --git a/orchestra/contrib/webapps/migrations/0001_initial.py b/orchestra/contrib/webapps/migrations/0001_initial.py index 1aee932f..7f0c5087 100644 --- a/orchestra/contrib/webapps/migrations/0001_initial.py +++ b/orchestra/contrib/webapps/migrations/0001_initial.py @@ -2,9 +2,9 @@ from __future__ import unicode_literals from django.db import models, migrations -from django.conf import settings import orchestra.core.validators import jsonfield.fields +from django.conf import settings class Migration(migrations.Migration): @@ -17,11 +17,11 @@ class Migration(migrations.Migration): migrations.CreateModel( name='WebApp', fields=[ - ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')), - ('name', models.CharField(max_length=128, validators=[orchestra.core.validators.validate_name], help_text='The app will be installed in %(home)s/webapps/%(app_name)s', verbose_name='name')), - ('type', models.CharField(max_length=32, choices=[('php', 'PHP'), ('python', 'Python'), ('static', 'Static'), ('symbolic-link', 'Symbolic link'), ('webalizer', 'Webalizer'), ('wordpress-php', 'WordPress')], verbose_name='type')), - ('data', jsonfield.fields.JSONField(verbose_name='data', help_text='Extra information dependent of each service.', blank=True, default={})), - ('account', models.ForeignKey(related_name='webapps', to=settings.AUTH_USER_MODEL, verbose_name='Account')), + ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), + ('name', models.CharField(verbose_name='name', validators=[orchestra.core.validators.validate_name], help_text='The app will be installed in %(home)s/webapps/%(app_name)s', max_length=128)), + ('type', models.CharField(verbose_name='type', max_length=32, choices=[('php', 'PHP'), ('python', 'Python'), ('static', 'Static'), ('symbolic-link', 'Symbolic link'), ('webalizer', 'Webalizer'), ('wordpress-php', 'WordPress')])), + ('data', jsonfield.fields.JSONField(verbose_name='data', blank=True, help_text='Extra information dependent of each service.', default={})), + ('account', models.ForeignKey(verbose_name='Account', related_name='webapps', to=settings.AUTH_USER_MODEL)), ], options={ 'verbose_name': 'Web App', @@ -31,10 +31,10 @@ class Migration(migrations.Migration): migrations.CreateModel( name='WebAppOption', fields=[ - ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')), - ('name', models.CharField(max_length=128, choices=[(None, '-------'), ('FileSystem', [('public-root', 'Public root')]), ('Process', [('timeout', 'Process timeout'), ('processes', 'Number of processes')]), ('PHP', [('enable_functions', 'Enable functions'), ('allow_url_include', 'Allow URL include'), ('allow_url_fopen', 'Allow URL fopen'), ('auto_append_file', 'Auto append file'), ('auto_prepend_file', 'Auto prepend file'), ('date.timezone', 'date.timezone'), ('default_socket_timeout', 'Default socket timeout'), ('display_errors', 'Display errors'), ('extension', 'Extension'), ('magic_quotes_gpc', 'Magic quotes GPC'), ('magic_quotes_runtime', 'Magic quotes runtime'), ('magic_quotes_sybase', 'Magic quotes sybase'), ('max_input_time', 'Max input time'), ('max_input_vars', 'Max input vars'), ('memory_limit', 'Memory limit'), ('mysql.connect_timeout', 'Mysql connect timeout'), ('output_buffering', 'Output buffering'), ('register_globals', 'Register globals'), ('post_max_size', 'Post max size'), ('sendmail_path', 'Sendmail path'), ('session.bug_compat_warn', 'Session bug compat warning'), ('session.auto_start', 'Session auto start'), ('safe_mode', 'Safe mode'), ('suhosin.post.max_vars', 'Suhosin POST max vars'), ('suhosin.get.max_vars', 'Suhosin GET max vars'), ('suhosin.request.max_vars', 'Suhosin request max vars'), ('suhosin.session.encrypt', 'Suhosin session encrypt'), ('suhosin.simulation', 'Suhosin simulation'), ('suhosin.executor.include.whitelist', 'Suhosin executor include whitelist'), ('upload_max_filesize', 'Upload max filesize'), ('zend_extension', 'Zend extension')])], verbose_name='name')), - ('value', models.CharField(max_length=256, verbose_name='value')), - ('webapp', models.ForeignKey(related_name='options', to='webapps.WebApp', verbose_name='Web application')), + ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), + ('name', models.CharField(verbose_name='name', max_length=128, choices=[(None, '-------'), ('FileSystem', [('public-root', 'Public root')]), ('Process', [('timeout', 'Process timeout'), ('processes', 'Number of processes')]), ('PHP', [('enable_functions', 'Enable functions'), ('allow_url_include', 'Allow URL include'), ('allow_url_fopen', 'Allow URL fopen'), ('auto_append_file', 'Auto append file'), ('auto_prepend_file', 'Auto prepend file'), ('date.timezone', 'date.timezone'), ('default_socket_timeout', 'Default socket timeout'), ('display_errors', 'Display errors'), ('extension', 'Extension'), ('magic_quotes_gpc', 'Magic quotes GPC'), ('magic_quotes_runtime', 'Magic quotes runtime'), ('magic_quotes_sybase', 'Magic quotes sybase'), ('max_input_time', 'Max input time'), ('max_input_vars', 'Max input vars'), ('memory_limit', 'Memory limit'), ('mysql.connect_timeout', 'Mysql connect timeout'), ('output_buffering', 'Output buffering'), ('register_globals', 'Register globals'), ('post_max_size', 'Post max size'), ('sendmail_path', 'Sendmail path'), ('session.bug_compat_warn', 'Session bug compat warning'), ('session.auto_start', 'Session auto start'), ('safe_mode', 'Safe mode'), ('suhosin.post.max_vars', 'Suhosin POST max vars'), ('suhosin.get.max_vars', 'Suhosin GET max vars'), ('suhosin.request.max_vars', 'Suhosin request max vars'), ('suhosin.session.encrypt', 'Suhosin session encrypt'), ('suhosin.simulation', 'Suhosin simulation'), ('suhosin.executor.include.whitelist', 'Suhosin executor include whitelist'), ('upload_max_filesize', 'Upload max filesize'), ('zend_extension', 'Zend extension')])])), + ('value', models.CharField(verbose_name='value', max_length=256)), + ('webapp', models.ForeignKey(verbose_name='Web application', related_name='options', to='webapps.WebApp')), ], options={ 'verbose_name': 'option', diff --git a/orchestra/contrib/websites/migrations/0001_initial.py b/orchestra/contrib/websites/migrations/0001_initial.py index c018dbfd..083875de 100644 --- a/orchestra/contrib/websites/migrations/0001_initial.py +++ b/orchestra/contrib/websites/migrations/0001_initial.py @@ -2,46 +2,46 @@ from __future__ import unicode_literals from django.db import models, migrations -import orchestra.core.validators from django.conf import settings +import orchestra.core.validators class Migration(migrations.Migration): dependencies = [ - ('webapps', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('domains', '0001_initial'), + ('webapps', '0001_initial'), ] operations = [ migrations.CreateModel( name='Content', fields=[ - ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), - ('path', models.CharField(verbose_name='path', validators=[orchestra.core.validators.validate_url_path], blank=True, max_length=256)), + ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), + ('path', models.CharField(validators=[orchestra.core.validators.validate_url_path], verbose_name='path', max_length=256, blank=True)), ('webapp', models.ForeignKey(verbose_name='web application', to='webapps.WebApp')), ], ), migrations.CreateModel( name='Website', fields=[ - ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), - ('name', models.CharField(verbose_name='name', validators=[orchestra.core.validators.validate_name], max_length=128)), + ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), + ('name', models.CharField(validators=[orchestra.core.validators.validate_name], verbose_name='name', max_length=128)), ('protocol', models.CharField(verbose_name='protocol', default='http', choices=[('http', 'HTTP'), ('https', 'HTTPS'), ('http/https', 'HTTP and HTTPS'), ('https-only', 'HTTPS only')], help_text='Select the protocol(s) for this website
HTTPS only performs a redirection from http to https.', max_length=16)), ('is_active', models.BooleanField(verbose_name='active', default=True)), - ('account', models.ForeignKey(verbose_name='Account', related_name='websites', to=settings.AUTH_USER_MODEL)), - ('contents', models.ManyToManyField(to='webapps.WebApp', through='websites.Content')), - ('domains', models.ManyToManyField(verbose_name='domains', to='domains.Domain', related_name='websites')), + ('account', models.ForeignKey(related_name='websites', verbose_name='Account', to=settings.AUTH_USER_MODEL)), + ('contents', models.ManyToManyField(through='websites.Content', to='webapps.WebApp')), + ('domains', models.ManyToManyField(verbose_name='domains', related_name='websites', to='domains.Domain')), ], ), migrations.CreateModel( name='WebsiteDirective', fields=[ - ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), - ('name', models.CharField(verbose_name='name', choices=[(None, '-------'), ('ModSecurity', [('sec-rule-remove', 'SecRuleRemoveById'), ('sec-engine', 'SecRuleEngine Off')]), ('SSL', [('ssl-ca', 'SSL CA'), ('ssl-cert', 'SSL cert'), ('ssl-key', 'SSL key')]), ('HTTPD', [('redirect', 'Redirection'), ('proxy', 'Proxy'), ('error-document', 'ErrorDocumentRoot')]), ('SaaS', [('wordpress-saas', 'WordPress SaaS'), ('dokuwiki-saas', 'DokuWiki SaaS'), ('drupal-saas', 'Drupdal SaaS')])], max_length=128)), + ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), + ('name', models.CharField(verbose_name='name', choices=[(None, '-------'), ('SSL', [('ssl-ca', 'SSL CA'), ('ssl-cert', 'SSL cert'), ('ssl-key', 'SSL key')]), ('HTTPD', [('redirect', 'Redirection'), ('proxy', 'Proxy'), ('error-document', 'ErrorDocumentRoot')]), ('ModSecurity', [('sec-rule-remove', 'SecRuleRemoveById'), ('sec-engine', 'SecRuleEngine Off')]), ('SaaS', [('wordpress-saas', 'WordPress SaaS'), ('dokuwiki-saas', 'DokuWiki SaaS'), ('drupal-saas', 'Drupdal SaaS')])], max_length=128)), ('value', models.CharField(verbose_name='value', max_length=256)), - ('website', models.ForeignKey(verbose_name='web site', related_name='directives', to='websites.Website')), + ('website', models.ForeignKey(related_name='directives', verbose_name='web site', to='websites.Website')), ], ), migrations.AddField(