Skip to content

Commit cd6a4a8

Browse files
committed
Fix migrations import
1 parent 7a70e3b commit cd6a4a8

26 files changed

+51
-32
lines changed

plain-cache/plain/cache/migrations/0001_initial.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20231127233940 on 2023-12-22 03:47
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-flags/plain/flags/migrations/0001_initial.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
import plain.flags.models
66
import plain.models.deletion
7-
from plain.models import migrations, models
7+
from plain import models
8+
from plain.models import migrations
89

910

1011
class Migration(migrations.Migration):

plain-models/plain/models/migrations/writer.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,7 @@ def as_string(self):
162162
imports.remove(line)
163163
self.needs_manual_porting = True
164164

165-
# plain.models.migrations is always used, but models import may not be.
166-
# If models import exists, merge it with migrations import.
167-
if "from plain import models" in imports:
168-
imports.discard("from plain import models")
169-
imports.add("from plain.models import migrations, models")
170-
else:
171-
imports.add("from plain.models import migrations")
165+
imports.add("from plain.models import migrations")
172166

173167
# Sort imports by the package / module to be imported (the part after
174168
# "from" in "from ... import ..." or after "import" in "import ...").

plain-oauth/plain/oauth/migrations/0001_initial.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Generated by Plain 4.0.3 on 2022-03-16 19:11
22

33
import plain.models.deletion
4-
from plain.models import migrations, models
4+
from plain import models
5+
from plain.models import migrations
56
from plain.runtime import settings
67

78

plain-oauth/plain/oauth/migrations/0002_alter_oauthconnection_options_and_more.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 4.0.3 on 2022-03-18 18:24
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-oauth/plain/oauth/migrations/0003_alter_oauthconnection_access_token_and_more.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 4.0.6 on 2022-08-11 19:18
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-oauth/plain/oauth/migrations/0004_alter_oauthconnection_access_token_and_more.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20230806030948 on 2023-08-08 19:32
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-oauth/tests/users/migrations/0001_initial.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import plain.auth.models
44
import plain.auth.validators
55
import plain.utils.timezone
6-
from plain.models import migrations, models
6+
from plain import models
7+
from plain.models import migrations
78

89

910
class Migration(migrations.Migration):

plain-sessions/plain/sessions/migrations/0001_initial.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import plain.sessions.models
2-
from plain.models import migrations, models
2+
from plain import models
3+
from plain.models import migrations
34

45

56
class Migration(migrations.Migration):

plain-sessions/plain/sessions/migrations/0002_alter_session_options_alter_session_expire_date_and_more.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20230814020017 on 2023-08-14 02:09
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-staff/plain/staff/admin/migrations/0001_initial.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20230914205221 on 2023-09-15 17:17
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-staff/plain/staff/admin/migrations/0002_alter_dashboard_cards.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20230914205221 on 2023-09-15 17:51
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-worker/plain/worker/migrations/0001_initial.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import uuid
44

5-
from plain.models import migrations, models
5+
from plain import models
6+
from plain.models import migrations
67

78

89
class Migration(migrations.Migration):

plain-worker/plain/worker/migrations/0002_jobresult_remove_jobrequest_completed_at_and_more.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import uuid
44

5-
from plain.models import migrations, models
5+
from plain import models
6+
from plain.models import migrations
67

78

89
class Migration(migrations.Migration):

plain-worker/plain/worker/migrations/0003_jobresult_status.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20231226225312 on 2023-12-28 19:28
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-worker/plain/worker/migrations/0007_alter_jobresult_status.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20231229213240 on 2023-12-30 02:35
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-worker/plain/worker/migrations/0008_jobrequest_source_jobresult_source.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20240102205958 on 2024-01-02 21:12
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-worker/plain/worker/migrations/0009_alter_jobresult_status.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20240109202955 on 2024-01-09 21:36
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-worker/plain/worker/migrations/0010_alter_jobresult_status.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20240109225803 on 2024-01-09 23:17
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-worker/plain/worker/migrations/0011_jobrequest_retries_jobrequest_retry_attempt_and_more.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20240109233227 on 2024-01-10 00:25
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-worker/plain/worker/migrations/0012_job_jobresult_job_uuid_alter_jobresult_status.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import uuid
44

5-
from plain.models import migrations, models
5+
from plain import models
6+
from plain.models import migrations
67

78

89
class Migration(migrations.Migration):

plain-worker/plain/worker/migrations/0013_alter_job_options_alter_jobresult_options_and_more.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20240114170303 on 2024-01-17 19:24
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-worker/plain/worker/migrations/0014_job_unique_key_jobrequest_unique_key_and_more.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20240117193239 on 2024-01-17 19:41
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-worker/plain/worker/migrations/0015_job_worker_uuid_jobresult_worker_uuid_and_more.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20240118212224 on 2024-01-18 21:53
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-worker/plain/worker/migrations/0017_job_queue_jobrequest_queue_jobresult_queue.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20240321171720 on 2024-03-21 18:47
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

plain-worker/plain/worker/migrations/0018_jobrequest_unique_job_class_unique_key.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated by Plain 5.0.dev20240514194324 on 2024-05-14 20:03
22

3-
from plain.models import migrations, models
3+
from plain import models
4+
from plain.models import migrations
45

56

67
class Migration(migrations.Migration):

0 commit comments

Comments
 (0)