Skip to content

Commit b0814a1

Browse files
committed
Apply black to migrations
1 parent 0e53698 commit b0814a1

9 files changed

+798
-59
lines changed

aggregator/migrations/0004_add_local_django_community.py

Lines changed: 62 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,75 @@
77
class Migration(migrations.Migration):
88

99
dependencies = [
10-
('aggregator', '0003_increase_url_max_length'),
10+
("aggregator", "0003_increase_url_max_length"),
1111
]
1212

1313
operations = [
1414
migrations.CreateModel(
15-
name='LocalDjangoCommunity',
15+
name="LocalDjangoCommunity",
1616
fields=[
17-
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18-
('name', models.CharField(max_length=120)),
19-
('description', models.TextField()),
20-
('slug', models.SlugField(max_length=125)),
21-
('city', models.CharField(max_length=85)),
22-
('country', django_countries.fields.CountryField(max_length=2)),
23-
('continent', models.CharField(choices=[('Africa', 'Africa'), ('North America', 'North America'), ('South America', 'South America'), ('Europe', 'Europe'), ('Asia', 'Asia'), ('Oceania', 'Oceania'), ('Antarctica', 'Antarctica')], max_length=15)),
24-
('website_url', models.URLField(blank=True, default=None, max_length=250, null=True)),
25-
('event_site_url', models.URLField(blank=True, default=None, max_length=250, null=True)),
26-
('is_active', models.BooleanField(default=True)),
27-
('created_at', models.DateTimeField(auto_now_add=True)),
17+
(
18+
"id",
19+
models.AutoField(
20+
auto_created=True,
21+
primary_key=True,
22+
serialize=False,
23+
verbose_name="ID",
24+
),
25+
),
26+
("name", models.CharField(max_length=120)),
27+
("description", models.TextField()),
28+
("slug", models.SlugField(max_length=125)),
29+
("city", models.CharField(max_length=85)),
30+
("country", django_countries.fields.CountryField(max_length=2)),
31+
(
32+
"continent",
33+
models.CharField(
34+
choices=[
35+
("Africa", "Africa"),
36+
("North America", "North America"),
37+
("South America", "South America"),
38+
("Europe", "Europe"),
39+
("Asia", "Asia"),
40+
("Oceania", "Oceania"),
41+
("Antarctica", "Antarctica"),
42+
],
43+
max_length=15,
44+
),
45+
),
46+
(
47+
"website_url",
48+
models.URLField(
49+
blank=True, default=None, max_length=250, null=True
50+
),
51+
),
52+
(
53+
"event_site_url",
54+
models.URLField(
55+
blank=True, default=None, max_length=250, null=True
56+
),
57+
),
58+
("is_active", models.BooleanField(default=True)),
59+
("created_at", models.DateTimeField(auto_now_add=True)),
2860
],
2961
),
3062
migrations.AddConstraint(
31-
model_name='localdjangocommunity',
32-
constraint=models.CheckConstraint(condition=models.Q(models.Q(('event_site_url__isnull', False), ('website_url__isnull', False)), models.Q(('event_site_url__isnull', False), ('website_url__isnull', True)), models.Q(('event_site_url__isnull', True), ('website_url__isnull', False)), _connector='OR'), name='website_url_and_or_event_site_url'),
63+
model_name="localdjangocommunity",
64+
constraint=models.CheckConstraint(
65+
condition=models.Q(
66+
models.Q(
67+
("event_site_url__isnull", False),
68+
("website_url__isnull", False),
69+
),
70+
models.Q(
71+
("event_site_url__isnull", False), ("website_url__isnull", True)
72+
),
73+
models.Q(
74+
("event_site_url__isnull", True), ("website_url__isnull", False)
75+
),
76+
_connector="OR",
77+
),
78+
name="website_url_and_or_event_site_url",
79+
),
3380
),
3481
]

aggregator/migrations/0005_feeditem_add_index_date_modified.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
class Migration(migrations.Migration):
77

88
dependencies = [
9-
('aggregator', '0004_add_local_django_community'),
9+
("aggregator", "0004_add_local_django_community"),
1010
]
1111

1212
operations = [
1313
migrations.AddIndex(
14-
model_name='feeditem',
15-
index=models.Index(fields=['-date_modified'], name='aggregator__date_mo_d6dfa1_idx'),
14+
model_name="feeditem",
15+
index=models.Index(
16+
fields=["-date_modified"], name="aggregator__date_mo_d6dfa1_idx"
17+
),
1618
),
1719
]

aggregator/migrations/0006_localdjangocommunity_plural.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
class Migration(migrations.Migration):
77

88
dependencies = [
9-
('aggregator', '0005_feeditem_add_index_date_modified'),
9+
("aggregator", "0005_feeditem_add_index_date_modified"),
1010
]
1111

1212
operations = [
1313
migrations.AlterModelOptions(
14-
name='localdjangocommunity',
15-
options={'verbose_name_plural': 'Local Django Communities'},
14+
name="localdjangocommunity",
15+
options={"verbose_name_plural": "Local Django Communities"},
1616
),
1717
]

blog/migrations/0004_imageupload.py

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,50 @@
88
class Migration(migrations.Migration):
99

1010
dependencies = [
11-
('blog', '0003_entry_content_format_markdown'),
11+
("blog", "0003_entry_content_format_markdown"),
1212
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
1313
]
1414

1515
operations = [
1616
migrations.CreateModel(
17-
name='ImageUpload',
17+
name="ImageUpload",
1818
fields=[
19-
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
20-
('title', models.CharField(help_text='Not published anywhere, just used internally', max_length=100)),
21-
('image', models.FileField(upload_to='blog/images/%Y/%m/')),
22-
('alt_text', models.TextField(help_text='Make the extra effort, it makes a difference 💖')),
23-
('uploaded_on', models.DateTimeField(auto_now_add=True)),
24-
('uploaded_by', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
19+
(
20+
"id",
21+
models.AutoField(
22+
auto_created=True,
23+
primary_key=True,
24+
serialize=False,
25+
verbose_name="ID",
26+
),
27+
),
28+
(
29+
"title",
30+
models.CharField(
31+
help_text="Not published anywhere, just used internally",
32+
max_length=100,
33+
),
34+
),
35+
("image", models.FileField(upload_to="blog/images/%Y/%m/")),
36+
(
37+
"alt_text",
38+
models.TextField(
39+
help_text="Make the extra effort, it makes a difference 💖"
40+
),
41+
),
42+
("uploaded_on", models.DateTimeField(auto_now_add=True)),
43+
(
44+
"uploaded_by",
45+
models.ForeignKey(
46+
editable=False,
47+
null=True,
48+
on_delete=django.db.models.deletion.SET_NULL,
49+
to=settings.AUTH_USER_MODEL,
50+
),
51+
),
2552
],
2653
options={
27-
'ordering': ('-uploaded_on',),
54+
"ordering": ("-uploaded_on",),
2855
},
2956
),
3057
]

blog/migrations/0005_entry_social_media_card.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@
77
class Migration(migrations.Migration):
88

99
dependencies = [
10-
('blog', '0004_imageupload'),
10+
("blog", "0004_imageupload"),
1111
]
1212

1313
operations = [
1414
migrations.AddField(
15-
model_name='entry',
16-
name='social_media_card',
17-
field=models.ForeignKey(blank=True, help_text='For maximum compatibility, the image should be < 5 MB and at least 1200x627 px.', null=True, on_delete=django.db.models.deletion.PROTECT, to='blog.imageupload'),
15+
model_name="entry",
16+
name="social_media_card",
17+
field=models.ForeignKey(
18+
blank=True,
19+
help_text="For maximum compatibility, the image should be < 5 MB and at least 1200x627 px.",
20+
null=True,
21+
on_delete=django.db.models.deletion.PROTECT,
22+
to="blog.imageupload",
23+
),
1824
),
1925
]

0 commit comments

Comments
 (0)