From 8802960bf62d6183eb177afbf10fa7acf09211d3 Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Fri, 12 Jun 2015 12:17:16 +0000 Subject: [PATCH] Added migrations0 --- .../migrations/0003_auto_20150612_0944.py | 24 +++++++++++++++++++ orchestra/contrib/webapps/utils.py | 10 ++++++++ 2 files changed, 34 insertions(+) create mode 100644 orchestra/contrib/bills/migrations/0003_auto_20150612_0944.py create mode 100644 orchestra/contrib/webapps/utils.py diff --git a/orchestra/contrib/bills/migrations/0003_auto_20150612_0944.py b/orchestra/contrib/bills/migrations/0003_auto_20150612_0944.py new file mode 100644 index 00000000..1b6691c4 --- /dev/null +++ b/orchestra/contrib/bills/migrations/0003_auto_20150612_0944.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('bills', '0002_auto_20150429_1417'), + ] + + operations = [ + migrations.AlterField( + model_name='bill', + name='total', + field=models.DecimalField(null=True, decimal_places=2, max_digits=12), + ), + migrations.AlterField( + model_name='billcontact', + name='country', + field=models.CharField(choices=[('MX', 'Mexico'), ('RE', 'Réunion'), ('RW', 'Rwanda'), ('RS', 'Serbia'), ('KM', 'Comoros'), ('KP', "Korea (the Democratic People's Republic of)"), ('GA', 'Gabon'), ('CG', 'Congo'), ('RU', 'Russian Federation'), ('CM', 'Cameroon'), ('DO', 'Dominican Republic'), ('AG', 'Antigua and Barbuda'), ('SC', 'Seychelles'), ('TW', 'Taiwan (Province of China)'), ('SJ', 'Svalbard and Jan Mayen'), ('SM', 'San Marino'), ('ZA', 'South Africa'), ('TC', 'Turks and Caicos Islands'), ('AI', 'Anguilla'), ('EG', 'Egypt'), ('CI', "Côte d'Ivoire"), ('SV', 'El Salvador'), ('BN', 'Brunei Darussalam'), ('CF', 'Central African Republic'), ('QA', 'Qatar'), ('BO', 'Bolivia (Plurinational State of)'), ('IQ', 'Iraq'), ('AS', 'American Samoa'), ('TG', 'Togo'), ('FM', 'Micronesia (Federated States of)'), ('IL', 'Israel'), ('BF', 'Burkina Faso'), ('SI', 'Slovenia'), ('PT', 'Portugal'), ('FI', 'Finland'), ('BA', 'Bosnia and Herzegovina'), ('CX', 'Christmas Island'), ('BQ', 'Bonaire, Sint Eustatius and Saba'), ('GI', 'Gibraltar'), ('UY', 'Uruguay'), ('NR', 'Nauru'), ('BI', 'Burundi'), ('MO', 'Macao'), ('BV', 'Bouvet Island'), ('TD', 'Chad'), ('CW', 'Curaçao'), ('UG', 'Uganda'), ('GD', 'Grenada'), ('HM', 'Heard Island and McDonald Islands'), ('PA', 'Panama'), ('SA', 'Saudi Arabia'), ('PK', 'Pakistan'), ('LU', 'Luxembourg'), ('LC', 'Saint Lucia'), ('PS', 'Palestine, State of'), ('TM', 'Turkmenistan'), ('BL', 'Saint Barthélemy'), ('IR', 'Iran (Islamic Republic of)'), ('SO', 'Somalia'), ('CO', 'Colombia'), ('BE', 'Belgium'), ('MT', 'Malta'), ('ZM', 'Zambia'), ('VN', 'Viet Nam'), ('MG', 'Madagascar'), ('AX', 'Åland Islands'), ('ME', 'Montenegro'), ('BD', 'Bangladesh'), ('CK', 'Cook Islands'), ('US', 'United States of America'), ('HT', 'Haiti'), ('MQ', 'Martinique'), ('JP', 'Japan'), ('BZ', 'Belize'), ('CZ', 'Czech Republic'), ('IO', 'British Indian Ocean Territory'), ('RO', 'Romania'), ('BB', 'Barbados'), ('EH', 'Western Sahara'), ('HN', 'Honduras'), ('IS', 'Iceland'), ('ZW', 'Zimbabwe'), ('YE', 'Yemen'), ('ER', 'Eritrea'), ('CU', 'Cuba'), ('TT', 'Trinidad and Tobago'), ('AR', 'Argentina'), ('GU', 'Guam'), ('BT', 'Bhutan'), ('AM', 'Armenia'), ('GG', 'Guernsey'), ('LT', 'Lithuania'), ('KZ', 'Kazakhstan'), ('MU', 'Mauritius'), ('FO', 'Faroe Islands'), ('SB', 'Solomon Islands'), ('TJ', 'Tajikistan'), ('NF', 'Norfolk Island'), ('GP', 'Guadeloupe'), ('AD', 'Andorra'), ('PR', 'Puerto Rico'), ('AO', 'Angola'), ('BY', 'Belarus'), ('CY', 'Cyprus'), ('IM', 'Isle of Man'), ('DK', 'Denmark'), ('FK', 'Falkland Islands [Malvinas]'), ('MH', 'Marshall Islands'), ('CD', 'Congo (the Democratic Republic of the)'), ('GB', 'United Kingdom of Great Britain and Northern Ireland'), ('UM', 'United States Minor Outlying Islands'), ('CN', 'China'), ('FJ', 'Fiji'), ('DZ', 'Algeria'), ('DM', 'Dominica'), ('MZ', 'Mozambique'), ('GL', 'Greenland'), ('AQ', 'Antarctica'), ('GS', 'South Georgia and the South Sandwich Islands'), ('GQ', 'Equatorial Guinea'), ('MP', 'Northern Mariana Islands'), ('SX', 'Sint Maarten (Dutch part)'), ('GT', 'Guatemala'), ('CA', 'Canada'), ('IN', 'India'), ('MF', 'Saint Martin (French part)'), ('VA', 'Holy See'), ('MA', 'Morocco'), ('PF', 'French Polynesia'), ('SH', 'Saint Helena, Ascension and Tristan da Cunha'), ('NP', 'Nepal'), ('LI', 'Liechtenstein'), ('GE', 'Georgia'), ('TL', 'Timor-Leste'), ('WS', 'Samoa'), ('TV', 'Tuvalu'), ('TO', 'Tonga'), ('ID', 'Indonesia'), ('VG', 'Virgin Islands (British)'), ('LR', 'Liberia'), ('BW', 'Botswana'), ('PG', 'Papua New Guinea'), ('AZ', 'Azerbaijan'), ('CH', 'Switzerland'), ('AF', 'Afghanistan'), ('HK', 'Hong Kong'), ('NE', 'Niger'), ('JO', 'Jordan'), ('ST', 'Sao Tome and Principe'), ('NU', 'Niue'), ('ET', 'Ethiopia'), ('KW', 'Kuwait'), ('MK', 'Macedonia (the former Yugoslav Republic of)'), ('SZ', 'Swaziland'), ('PN', 'Pitcairn'), ('MD', 'Moldova (the Republic of)'), ('PW', 'Palau'), ('LB', 'Lebanon'), ('MS', 'Montserrat'), ('SE', 'Sweden'), ('VI', 'Virgin Islands (U.S.)'), ('GN', 'Guinea'), ('TZ', 'Tanzania, United Republic of'), ('TR', 'Turkey'), ('PY', 'Paraguay'), ('NI', 'Nicaragua'), ('IT', 'Italy'), ('SN', 'Senegal'), ('CV', 'Cabo Verde'), ('BS', 'Bahamas'), ('BR', 'Brazil'), ('DJ', 'Djibouti'), ('AL', 'Albania'), ('GF', 'French Guiana'), ('KI', 'Kiribati'), ('VU', 'Vanuatu'), ('GM', 'Gambia'), ('SS', 'South Sudan'), ('TF', 'French Southern Territories'), ('BH', 'Bahrain'), ('MN', 'Mongolia'), ('KN', 'Saint Kitts and Nevis'), ('NL', 'Netherlands'), ('LK', 'Sri Lanka'), ('PE', 'Peru'), ('TK', 'Tokelau'), ('YT', 'Mayotte'), ('TN', 'Tunisia'), ('SG', 'Singapore'), ('BJ', 'Benin'), ('GH', 'Ghana'), ('KR', 'Korea (the Republic of)'), ('CR', 'Costa Rica'), ('JM', 'Jamaica'), ('AU', 'Australia'), ('KE', 'Kenya'), ('MM', 'Myanmar'), ('NA', 'Namibia'), ('UZ', 'Uzbekistan'), ('GR', 'Greece'), ('MR', 'Mauritania'), ('PL', 'Poland'), ('SY', 'Syrian Arab Republic'), ('MY', 'Malaysia'), ('EE', 'Estonia'), ('NZ', 'New Zealand'), ('MC', 'Monaco'), ('HU', 'Hungary'), ('SD', 'Sudan'), ('NG', 'Nigeria'), ('LA', "Lao People's Democratic Republic"), ('SK', 'Slovakia'), ('GY', 'Guyana'), ('UA', 'Ukraine'), ('BM', 'Bermuda'), ('AE', 'United Arab Emirates'), ('VC', 'Saint Vincent and the Grenadines'), ('AW', 'Aruba'), ('JE', 'Jersey'), ('PH', 'Philippines'), ('KH', 'Cambodia'), ('PM', 'Saint Pierre and Miquelon'), ('MW', 'Malawi'), ('HR', 'Croatia'), ('CL', 'Chile'), ('CC', 'Cocos (Keeling) Islands'), ('NC', 'New Caledonia'), ('LS', 'Lesotho'), ('SR', 'Suriname'), ('VE', 'Venezuela (Bolivarian Republic of)'), ('ES', 'Spain'), ('DE', 'Germany'), ('EC', 'Ecuador'), ('LV', 'Latvia'), ('LY', 'Libya'), ('NO', 'Norway'), ('WF', 'Wallis and Futuna'), ('GW', 'Guinea-Bissau'), ('ML', 'Mali'), ('FR', 'France'), ('TH', 'Thailand'), ('AT', 'Austria'), ('SL', 'Sierra Leone'), ('IE', 'Ireland'), ('KY', 'Cayman Islands'), ('BG', 'Bulgaria'), ('KG', 'Kyrgyzstan'), ('MV', 'Maldives'), ('OM', 'Oman')], max_length=20, verbose_name='country', default='ES'), + ), + ] diff --git a/orchestra/contrib/webapps/utils.py b/orchestra/contrib/webapps/utils.py new file mode 100644 index 00000000..35388cee --- /dev/null +++ b/orchestra/contrib/webapps/utils.py @@ -0,0 +1,10 @@ +import re + + +def extract_version_number(version): + number = re.findall(r'[0-9]+\.?[0-9]?', version) + if not number: + raise ValueError("No version number matches for '%s'" % version) + if len(number) > 1: + raise ValueError("Multiple version number matches for '%s'" % version) + return number[0]