wbnews 2.2.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wbnews/.coveragerc +23 -0
- wbnews/__init__.py +1 -0
- wbnews/admin.py +27 -0
- wbnews/apps.py +9 -0
- wbnews/factories.py +33 -0
- wbnews/import_export/__init__.py +0 -0
- wbnews/import_export/backends/__init__.py +1 -0
- wbnews/import_export/backends/news.py +35 -0
- wbnews/import_export/handlers/__init__.py +1 -0
- wbnews/import_export/handlers/news.py +25 -0
- wbnews/import_export/parsers/__init__.py +0 -0
- wbnews/import_export/parsers/emails/__init__.py +0 -0
- wbnews/import_export/parsers/emails/news.py +48 -0
- wbnews/import_export/parsers/emails/utils.py +61 -0
- wbnews/import_export/parsers/rss/__init__.py +0 -0
- wbnews/import_export/parsers/rss/news.py +63 -0
- wbnews/migrations/0001_initial_squashed_0005_alter_news_import_source.py +349 -0
- wbnews/migrations/0006_alter_news_language.py +122 -0
- wbnews/migrations/0007_auto_20240103_0955.py +43 -0
- wbnews/migrations/0008_alter_news_language.py +123 -0
- wbnews/migrations/0009_newsrelationship_analysis_newsrelationship_sentiment.py +94 -0
- wbnews/migrations/__init__.py +0 -0
- wbnews/models/__init__.py +3 -0
- wbnews/models/news.py +116 -0
- wbnews/models/relationships.py +20 -0
- wbnews/models/sources.py +43 -0
- wbnews/serializers.py +83 -0
- wbnews/signals.py +4 -0
- wbnews/tests/__init__.py +0 -0
- wbnews/tests/conftest.py +6 -0
- wbnews/tests/test_models.py +15 -0
- wbnews/tests/tests.py +12 -0
- wbnews/urls.py +29 -0
- wbnews/viewsets/__init__.py +12 -0
- wbnews/viewsets/buttons.py +23 -0
- wbnews/viewsets/display.py +133 -0
- wbnews/viewsets/endpoints.py +18 -0
- wbnews/viewsets/menu.py +23 -0
- wbnews/viewsets/titles.py +39 -0
- wbnews/viewsets/views.py +140 -0
- wbnews-2.2.1.dist-info/METADATA +8 -0
- wbnews-2.2.1.dist-info/RECORD +43 -0
- wbnews-2.2.1.dist-info/WHEEL +5 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
# Generated by Django 4.1.8 on 2023-04-19 05:31
|
|
2
|
+
|
|
3
|
+
import django.contrib.postgres.fields
|
|
4
|
+
import django.db.models.deletion
|
|
5
|
+
from django.db import migrations, models
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Migration(migrations.Migration):
|
|
9
|
+
initial = True
|
|
10
|
+
|
|
11
|
+
dependencies = [
|
|
12
|
+
("io", "0001_initial_squashed"),
|
|
13
|
+
("contenttypes", "0002_remove_content_type_name"),
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
operations = [
|
|
17
|
+
migrations.CreateModel(
|
|
18
|
+
name="NewsSource",
|
|
19
|
+
fields=[
|
|
20
|
+
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
|
21
|
+
("title", models.CharField(max_length=255)),
|
|
22
|
+
("identifier", models.CharField(blank=True, max_length=255, null=True, unique=True)),
|
|
23
|
+
(
|
|
24
|
+
"tags",
|
|
25
|
+
django.contrib.postgres.fields.ArrayField(
|
|
26
|
+
base_field=models.CharField(max_length=16), default=list, size=None
|
|
27
|
+
),
|
|
28
|
+
),
|
|
29
|
+
("image", models.URLField(blank=True, null=True)),
|
|
30
|
+
("description", models.TextField(default="")),
|
|
31
|
+
("author", models.CharField(default="", max_length=255)),
|
|
32
|
+
("url", models.URLField(blank=True, null=True, unique=True)),
|
|
33
|
+
],
|
|
34
|
+
),
|
|
35
|
+
migrations.CreateModel(
|
|
36
|
+
name="News",
|
|
37
|
+
fields=[
|
|
38
|
+
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
|
39
|
+
("datetime", models.DateTimeField()),
|
|
40
|
+
("title", models.CharField(max_length=500)),
|
|
41
|
+
("description", models.TextField(blank=True)),
|
|
42
|
+
("summary", models.TextField(blank=True)),
|
|
43
|
+
(
|
|
44
|
+
"language",
|
|
45
|
+
models.CharField(
|
|
46
|
+
blank=True,
|
|
47
|
+
choices=[
|
|
48
|
+
("af", "Afrikaans"),
|
|
49
|
+
("ar", "Arabic"),
|
|
50
|
+
("ar-dz", "Algerian Arabic"),
|
|
51
|
+
("ast", "Asturian"),
|
|
52
|
+
("az", "Azerbaijani"),
|
|
53
|
+
("bg", "Bulgarian"),
|
|
54
|
+
("be", "Belarusian"),
|
|
55
|
+
("bn", "Bengali"),
|
|
56
|
+
("br", "Breton"),
|
|
57
|
+
("bs", "Bosnian"),
|
|
58
|
+
("ca", "Catalan"),
|
|
59
|
+
("cs", "Czech"),
|
|
60
|
+
("cy", "Welsh"),
|
|
61
|
+
("da", "Danish"),
|
|
62
|
+
("de", "German"),
|
|
63
|
+
("dsb", "Lower Sorbian"),
|
|
64
|
+
("el", "Greek"),
|
|
65
|
+
("en", "English"),
|
|
66
|
+
("en-au", "Australian English"),
|
|
67
|
+
("en-gb", "British English"),
|
|
68
|
+
("eo", "Esperanto"),
|
|
69
|
+
("es", "Spanish"),
|
|
70
|
+
("es-ar", "Argentinian Spanish"),
|
|
71
|
+
("es-co", "Colombian Spanish"),
|
|
72
|
+
("es-mx", "Mexican Spanish"),
|
|
73
|
+
("es-ni", "Nicaraguan Spanish"),
|
|
74
|
+
("es-ve", "Venezuelan Spanish"),
|
|
75
|
+
("et", "Estonian"),
|
|
76
|
+
("eu", "Basque"),
|
|
77
|
+
("fa", "Persian"),
|
|
78
|
+
("fi", "Finnish"),
|
|
79
|
+
("fr", "French"),
|
|
80
|
+
("fy", "Frisian"),
|
|
81
|
+
("ga", "Irish"),
|
|
82
|
+
("gd", "Scottish Gaelic"),
|
|
83
|
+
("gl", "Galician"),
|
|
84
|
+
("he", "Hebrew"),
|
|
85
|
+
("hi", "Hindi"),
|
|
86
|
+
("hr", "Croatian"),
|
|
87
|
+
("hsb", "Upper Sorbian"),
|
|
88
|
+
("hu", "Hungarian"),
|
|
89
|
+
("hy", "Armenian"),
|
|
90
|
+
("ia", "Interlingua"),
|
|
91
|
+
("id", "Indonesian"),
|
|
92
|
+
("ig", "Igbo"),
|
|
93
|
+
("io", "Ido"),
|
|
94
|
+
("is", "Icelandic"),
|
|
95
|
+
("it", "Italian"),
|
|
96
|
+
("ja", "Japanese"),
|
|
97
|
+
("ka", "Georgian"),
|
|
98
|
+
("kab", "Kabyle"),
|
|
99
|
+
("kk", "Kazakh"),
|
|
100
|
+
("km", "Khmer"),
|
|
101
|
+
("kn", "Kannada"),
|
|
102
|
+
("ko", "Korean"),
|
|
103
|
+
("ky", "Kyrgyz"),
|
|
104
|
+
("lb", "Luxembourgish"),
|
|
105
|
+
("lt", "Lithuanian"),
|
|
106
|
+
("lv", "Latvian"),
|
|
107
|
+
("mk", "Macedonian"),
|
|
108
|
+
("ml", "Malayalam"),
|
|
109
|
+
("mn", "Mongolian"),
|
|
110
|
+
("mr", "Marathi"),
|
|
111
|
+
("ms", "Malay"),
|
|
112
|
+
("my", "Burmese"),
|
|
113
|
+
("nb", "Norwegian Bokmål"),
|
|
114
|
+
("ne", "Nepali"),
|
|
115
|
+
("nl", "Dutch"),
|
|
116
|
+
("nn", "Norwegian Nynorsk"),
|
|
117
|
+
("os", "Ossetic"),
|
|
118
|
+
("pa", "Punjabi"),
|
|
119
|
+
("pl", "Polish"),
|
|
120
|
+
("pt", "Portuguese"),
|
|
121
|
+
("pt-br", "Brazilian Portuguese"),
|
|
122
|
+
("ro", "Romanian"),
|
|
123
|
+
("ru", "Russian"),
|
|
124
|
+
("sk", "Slovak"),
|
|
125
|
+
("sl", "Slovenian"),
|
|
126
|
+
("sq", "Albanian"),
|
|
127
|
+
("sr", "Serbian"),
|
|
128
|
+
("sr-latn", "Serbian Latin"),
|
|
129
|
+
("sv", "Swedish"),
|
|
130
|
+
("sw", "Swahili"),
|
|
131
|
+
("ta", "Tamil"),
|
|
132
|
+
("te", "Telugu"),
|
|
133
|
+
("tg", "Tajik"),
|
|
134
|
+
("th", "Thai"),
|
|
135
|
+
("tk", "Turkmen"),
|
|
136
|
+
("tr", "Turkish"),
|
|
137
|
+
("tt", "Tatar"),
|
|
138
|
+
("udm", "Udmurt"),
|
|
139
|
+
("uk", "Ukrainian"),
|
|
140
|
+
("ur", "Urdu"),
|
|
141
|
+
("uz", "Uzbek"),
|
|
142
|
+
("vi", "Vietnamese"),
|
|
143
|
+
("zh-hans", "Simplified Chinese"),
|
|
144
|
+
("zh-hant", "Traditional Chinese"),
|
|
145
|
+
],
|
|
146
|
+
max_length=16,
|
|
147
|
+
null=True,
|
|
148
|
+
),
|
|
149
|
+
),
|
|
150
|
+
("link", models.CharField(blank=True, max_length=500, null=True)),
|
|
151
|
+
(
|
|
152
|
+
"tags",
|
|
153
|
+
django.contrib.postgres.fields.ArrayField(
|
|
154
|
+
base_field=models.CharField(max_length=16), default=list, size=None
|
|
155
|
+
),
|
|
156
|
+
),
|
|
157
|
+
(
|
|
158
|
+
"enclosures",
|
|
159
|
+
django.contrib.postgres.fields.ArrayField(base_field=models.URLField(), default=list, size=None),
|
|
160
|
+
),
|
|
161
|
+
("image_url", models.URLField(blank=True, null=True)),
|
|
162
|
+
(
|
|
163
|
+
"source",
|
|
164
|
+
models.ForeignKey(
|
|
165
|
+
on_delete=django.db.models.deletion.CASCADE, related_name="news", to="wbnews.newssource"
|
|
166
|
+
),
|
|
167
|
+
),
|
|
168
|
+
],
|
|
169
|
+
options={
|
|
170
|
+
"unique_together": {("title", "source", "datetime")},
|
|
171
|
+
},
|
|
172
|
+
bases=(models.Model,),
|
|
173
|
+
),
|
|
174
|
+
migrations.CreateModel(
|
|
175
|
+
name="NewsRelationship",
|
|
176
|
+
fields=[
|
|
177
|
+
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
|
178
|
+
("object_id", models.PositiveIntegerField()),
|
|
179
|
+
(
|
|
180
|
+
"content_type",
|
|
181
|
+
models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="contenttypes.contenttype"),
|
|
182
|
+
),
|
|
183
|
+
(
|
|
184
|
+
"news",
|
|
185
|
+
models.ForeignKey(
|
|
186
|
+
on_delete=django.db.models.deletion.CASCADE, related_name="relationships", to="wbnews.news"
|
|
187
|
+
),
|
|
188
|
+
),
|
|
189
|
+
],
|
|
190
|
+
options={
|
|
191
|
+
"verbose_name": "News Relationship",
|
|
192
|
+
},
|
|
193
|
+
),
|
|
194
|
+
migrations.AddIndex(
|
|
195
|
+
model_name="newsrelationship",
|
|
196
|
+
index=models.Index(fields=["content_type", "object_id"], name="wbnews_news_content_b40dfe_idx"),
|
|
197
|
+
),
|
|
198
|
+
migrations.AlterField(
|
|
199
|
+
model_name="news",
|
|
200
|
+
name="datetime",
|
|
201
|
+
field=models.DateTimeField(verbose_name="Datetime"),
|
|
202
|
+
),
|
|
203
|
+
migrations.AlterField(
|
|
204
|
+
model_name="news",
|
|
205
|
+
name="description",
|
|
206
|
+
field=models.TextField(blank=True, verbose_name="Description"),
|
|
207
|
+
),
|
|
208
|
+
migrations.AlterField(
|
|
209
|
+
model_name="news",
|
|
210
|
+
name="language",
|
|
211
|
+
field=models.CharField(
|
|
212
|
+
blank=True,
|
|
213
|
+
choices=[
|
|
214
|
+
("af", "Afrikaans"),
|
|
215
|
+
("ar", "Arabic"),
|
|
216
|
+
("ar-dz", "Algerian Arabic"),
|
|
217
|
+
("ast", "Asturian"),
|
|
218
|
+
("az", "Azerbaijani"),
|
|
219
|
+
("bg", "Bulgarian"),
|
|
220
|
+
("be", "Belarusian"),
|
|
221
|
+
("bn", "Bengali"),
|
|
222
|
+
("br", "Breton"),
|
|
223
|
+
("bs", "Bosnian"),
|
|
224
|
+
("ca", "Catalan"),
|
|
225
|
+
("cs", "Czech"),
|
|
226
|
+
("cy", "Welsh"),
|
|
227
|
+
("da", "Danish"),
|
|
228
|
+
("de", "German"),
|
|
229
|
+
("dsb", "Lower Sorbian"),
|
|
230
|
+
("el", "Greek"),
|
|
231
|
+
("en", "English"),
|
|
232
|
+
("en-au", "Australian English"),
|
|
233
|
+
("en-gb", "British English"),
|
|
234
|
+
("eo", "Esperanto"),
|
|
235
|
+
("es", "Spanish"),
|
|
236
|
+
("es-ar", "Argentinian Spanish"),
|
|
237
|
+
("es-co", "Colombian Spanish"),
|
|
238
|
+
("es-mx", "Mexican Spanish"),
|
|
239
|
+
("es-ni", "Nicaraguan Spanish"),
|
|
240
|
+
("es-ve", "Venezuelan Spanish"),
|
|
241
|
+
("et", "Estonian"),
|
|
242
|
+
("eu", "Basque"),
|
|
243
|
+
("fa", "Persian"),
|
|
244
|
+
("fi", "Finnish"),
|
|
245
|
+
("fr", "French"),
|
|
246
|
+
("fy", "Frisian"),
|
|
247
|
+
("ga", "Irish"),
|
|
248
|
+
("gd", "Scottish Gaelic"),
|
|
249
|
+
("gl", "Galician"),
|
|
250
|
+
("he", "Hebrew"),
|
|
251
|
+
("hi", "Hindi"),
|
|
252
|
+
("hr", "Croatian"),
|
|
253
|
+
("hsb", "Upper Sorbian"),
|
|
254
|
+
("hu", "Hungarian"),
|
|
255
|
+
("hy", "Armenian"),
|
|
256
|
+
("ia", "Interlingua"),
|
|
257
|
+
("id", "Indonesian"),
|
|
258
|
+
("ig", "Igbo"),
|
|
259
|
+
("io", "Ido"),
|
|
260
|
+
("is", "Icelandic"),
|
|
261
|
+
("it", "Italian"),
|
|
262
|
+
("ja", "Japanese"),
|
|
263
|
+
("ka", "Georgian"),
|
|
264
|
+
("kab", "Kabyle"),
|
|
265
|
+
("kk", "Kazakh"),
|
|
266
|
+
("km", "Khmer"),
|
|
267
|
+
("kn", "Kannada"),
|
|
268
|
+
("ko", "Korean"),
|
|
269
|
+
("ky", "Kyrgyz"),
|
|
270
|
+
("lb", "Luxembourgish"),
|
|
271
|
+
("lt", "Lithuanian"),
|
|
272
|
+
("lv", "Latvian"),
|
|
273
|
+
("mk", "Macedonian"),
|
|
274
|
+
("ml", "Malayalam"),
|
|
275
|
+
("mn", "Mongolian"),
|
|
276
|
+
("mr", "Marathi"),
|
|
277
|
+
("ms", "Malay"),
|
|
278
|
+
("my", "Burmese"),
|
|
279
|
+
("nb", "Norwegian Bokmål"),
|
|
280
|
+
("ne", "Nepali"),
|
|
281
|
+
("nl", "Dutch"),
|
|
282
|
+
("nn", "Norwegian Nynorsk"),
|
|
283
|
+
("os", "Ossetic"),
|
|
284
|
+
("pa", "Punjabi"),
|
|
285
|
+
("pl", "Polish"),
|
|
286
|
+
("pt", "Portuguese"),
|
|
287
|
+
("pt-br", "Brazilian Portuguese"),
|
|
288
|
+
("ro", "Romanian"),
|
|
289
|
+
("ru", "Russian"),
|
|
290
|
+
("sk", "Slovak"),
|
|
291
|
+
("sl", "Slovenian"),
|
|
292
|
+
("sq", "Albanian"),
|
|
293
|
+
("sr", "Serbian"),
|
|
294
|
+
("sr-latn", "Serbian Latin"),
|
|
295
|
+
("sv", "Swedish"),
|
|
296
|
+
("sw", "Swahili"),
|
|
297
|
+
("ta", "Tamil"),
|
|
298
|
+
("te", "Telugu"),
|
|
299
|
+
("tg", "Tajik"),
|
|
300
|
+
("th", "Thai"),
|
|
301
|
+
("tk", "Turkmen"),
|
|
302
|
+
("tr", "Turkish"),
|
|
303
|
+
("tt", "Tatar"),
|
|
304
|
+
("udm", "Udmurt"),
|
|
305
|
+
("uk", "Ukrainian"),
|
|
306
|
+
("ur", "Urdu"),
|
|
307
|
+
("uz", "Uzbek"),
|
|
308
|
+
("vi", "Vietnamese"),
|
|
309
|
+
("zh-hans", "Simplified Chinese"),
|
|
310
|
+
("zh-hant", "Traditional Chinese"),
|
|
311
|
+
],
|
|
312
|
+
max_length=16,
|
|
313
|
+
null=True,
|
|
314
|
+
verbose_name="Language",
|
|
315
|
+
),
|
|
316
|
+
),
|
|
317
|
+
migrations.AlterField(
|
|
318
|
+
model_name="news",
|
|
319
|
+
name="link",
|
|
320
|
+
field=models.CharField(blank=True, max_length=500, null=True, verbose_name="Link"),
|
|
321
|
+
),
|
|
322
|
+
migrations.AlterField(
|
|
323
|
+
model_name="news",
|
|
324
|
+
name="source",
|
|
325
|
+
field=models.ForeignKey(
|
|
326
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
327
|
+
related_name="news",
|
|
328
|
+
to="wbnews.newssource",
|
|
329
|
+
verbose_name="Source",
|
|
330
|
+
),
|
|
331
|
+
),
|
|
332
|
+
migrations.AlterField(
|
|
333
|
+
model_name="news",
|
|
334
|
+
name="summary",
|
|
335
|
+
field=models.TextField(blank=True, verbose_name="Summary"),
|
|
336
|
+
),
|
|
337
|
+
migrations.AlterField(
|
|
338
|
+
model_name="news",
|
|
339
|
+
name="title",
|
|
340
|
+
field=models.CharField(max_length=500, verbose_name="Title"),
|
|
341
|
+
),
|
|
342
|
+
migrations.AddField(
|
|
343
|
+
model_name="news",
|
|
344
|
+
name="import_source",
|
|
345
|
+
field=models.ForeignKey(
|
|
346
|
+
blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to="io.importsource"
|
|
347
|
+
),
|
|
348
|
+
),
|
|
349
|
+
]
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Generated by Django 4.2.6 on 2023-10-18 13:27
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
dependencies = [
|
|
8
|
+
("wbnews", "0001_initial_squashed_0005_alter_news_import_source"),
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
operations = [
|
|
12
|
+
migrations.AlterField(
|
|
13
|
+
model_name="news",
|
|
14
|
+
name="language",
|
|
15
|
+
field=models.CharField(
|
|
16
|
+
blank=True,
|
|
17
|
+
choices=[
|
|
18
|
+
("af", "Afrikaans"),
|
|
19
|
+
("ar", "Arabic"),
|
|
20
|
+
("ar-dz", "Algerian Arabic"),
|
|
21
|
+
("ast", "Asturian"),
|
|
22
|
+
("az", "Azerbaijani"),
|
|
23
|
+
("bg", "Bulgarian"),
|
|
24
|
+
("be", "Belarusian"),
|
|
25
|
+
("bn", "Bengali"),
|
|
26
|
+
("br", "Breton"),
|
|
27
|
+
("bs", "Bosnian"),
|
|
28
|
+
("ca", "Catalan"),
|
|
29
|
+
("ckb", "Central Kurdish (Sorani)"),
|
|
30
|
+
("cs", "Czech"),
|
|
31
|
+
("cy", "Welsh"),
|
|
32
|
+
("da", "Danish"),
|
|
33
|
+
("de", "German"),
|
|
34
|
+
("dsb", "Lower Sorbian"),
|
|
35
|
+
("el", "Greek"),
|
|
36
|
+
("en", "English"),
|
|
37
|
+
("en-au", "Australian English"),
|
|
38
|
+
("en-gb", "British English"),
|
|
39
|
+
("eo", "Esperanto"),
|
|
40
|
+
("es", "Spanish"),
|
|
41
|
+
("es-ar", "Argentinian Spanish"),
|
|
42
|
+
("es-co", "Colombian Spanish"),
|
|
43
|
+
("es-mx", "Mexican Spanish"),
|
|
44
|
+
("es-ni", "Nicaraguan Spanish"),
|
|
45
|
+
("es-ve", "Venezuelan Spanish"),
|
|
46
|
+
("et", "Estonian"),
|
|
47
|
+
("eu", "Basque"),
|
|
48
|
+
("fa", "Persian"),
|
|
49
|
+
("fi", "Finnish"),
|
|
50
|
+
("fr", "French"),
|
|
51
|
+
("fy", "Frisian"),
|
|
52
|
+
("ga", "Irish"),
|
|
53
|
+
("gd", "Scottish Gaelic"),
|
|
54
|
+
("gl", "Galician"),
|
|
55
|
+
("he", "Hebrew"),
|
|
56
|
+
("hi", "Hindi"),
|
|
57
|
+
("hr", "Croatian"),
|
|
58
|
+
("hsb", "Upper Sorbian"),
|
|
59
|
+
("hu", "Hungarian"),
|
|
60
|
+
("hy", "Armenian"),
|
|
61
|
+
("ia", "Interlingua"),
|
|
62
|
+
("id", "Indonesian"),
|
|
63
|
+
("ig", "Igbo"),
|
|
64
|
+
("io", "Ido"),
|
|
65
|
+
("is", "Icelandic"),
|
|
66
|
+
("it", "Italian"),
|
|
67
|
+
("ja", "Japanese"),
|
|
68
|
+
("ka", "Georgian"),
|
|
69
|
+
("kab", "Kabyle"),
|
|
70
|
+
("kk", "Kazakh"),
|
|
71
|
+
("km", "Khmer"),
|
|
72
|
+
("kn", "Kannada"),
|
|
73
|
+
("ko", "Korean"),
|
|
74
|
+
("ky", "Kyrgyz"),
|
|
75
|
+
("lb", "Luxembourgish"),
|
|
76
|
+
("lt", "Lithuanian"),
|
|
77
|
+
("lv", "Latvian"),
|
|
78
|
+
("mk", "Macedonian"),
|
|
79
|
+
("ml", "Malayalam"),
|
|
80
|
+
("mn", "Mongolian"),
|
|
81
|
+
("mr", "Marathi"),
|
|
82
|
+
("ms", "Malay"),
|
|
83
|
+
("my", "Burmese"),
|
|
84
|
+
("nb", "Norwegian Bokmål"),
|
|
85
|
+
("ne", "Nepali"),
|
|
86
|
+
("nl", "Dutch"),
|
|
87
|
+
("nn", "Norwegian Nynorsk"),
|
|
88
|
+
("os", "Ossetic"),
|
|
89
|
+
("pa", "Punjabi"),
|
|
90
|
+
("pl", "Polish"),
|
|
91
|
+
("pt", "Portuguese"),
|
|
92
|
+
("pt-br", "Brazilian Portuguese"),
|
|
93
|
+
("ro", "Romanian"),
|
|
94
|
+
("ru", "Russian"),
|
|
95
|
+
("sk", "Slovak"),
|
|
96
|
+
("sl", "Slovenian"),
|
|
97
|
+
("sq", "Albanian"),
|
|
98
|
+
("sr", "Serbian"),
|
|
99
|
+
("sr-latn", "Serbian Latin"),
|
|
100
|
+
("sv", "Swedish"),
|
|
101
|
+
("sw", "Swahili"),
|
|
102
|
+
("ta", "Tamil"),
|
|
103
|
+
("te", "Telugu"),
|
|
104
|
+
("tg", "Tajik"),
|
|
105
|
+
("th", "Thai"),
|
|
106
|
+
("tk", "Turkmen"),
|
|
107
|
+
("tr", "Turkish"),
|
|
108
|
+
("tt", "Tatar"),
|
|
109
|
+
("udm", "Udmurt"),
|
|
110
|
+
("uk", "Ukrainian"),
|
|
111
|
+
("ur", "Urdu"),
|
|
112
|
+
("uz", "Uzbek"),
|
|
113
|
+
("vi", "Vietnamese"),
|
|
114
|
+
("zh-hans", "Simplified Chinese"),
|
|
115
|
+
("zh-hant", "Traditional Chinese"),
|
|
116
|
+
],
|
|
117
|
+
max_length=16,
|
|
118
|
+
null=True,
|
|
119
|
+
verbose_name="Language",
|
|
120
|
+
),
|
|
121
|
+
),
|
|
122
|
+
]
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Generated by Django 4.2.8 on 2024-01-03 08:55
|
|
2
|
+
|
|
3
|
+
from contextlib import suppress
|
|
4
|
+
|
|
5
|
+
from django.apps import apps
|
|
6
|
+
from django.contrib.contenttypes.models import ContentType
|
|
7
|
+
from django.db import migrations
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def migrate_content_type(apps, schema_editor):
|
|
11
|
+
NewsRelationship = apps.get_model("wbnews", "NewsRelationship")
|
|
12
|
+
|
|
13
|
+
for model_name in [
|
|
14
|
+
"Classification",
|
|
15
|
+
"Instrument",
|
|
16
|
+
"ClassificationGroup",
|
|
17
|
+
"Deal",
|
|
18
|
+
"Exchange",
|
|
19
|
+
"InstrumentClassificationRelatedInstrument",
|
|
20
|
+
"InstrumentClassificationThroughModel",
|
|
21
|
+
"InstrumentFavoriteGroup",
|
|
22
|
+
"InstrumentList",
|
|
23
|
+
"InstrumentListThroughModel",
|
|
24
|
+
"InstrumentRequest",
|
|
25
|
+
"RelatedInstrumentThroughModel",
|
|
26
|
+
"InstrumentPrice",
|
|
27
|
+
]:
|
|
28
|
+
with suppress(ContentType.DoesNotExist):
|
|
29
|
+
old_ct = ContentType.objects.get(app_label="wbportfolio", model=model_name.lower())
|
|
30
|
+
new_ct = ContentType.objects.get(app_label="wbfdm", model=model_name.lower())
|
|
31
|
+
NewsRelationship.objects.filter(content_type_id=old_ct.id).update(content_type_id=new_ct.id)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class Migration(migrations.Migration):
|
|
35
|
+
dependencies = (
|
|
36
|
+
[
|
|
37
|
+
("wbnews", "0006_alter_news_language"),
|
|
38
|
+
("wbfdm", "0012_instrumentprice_created_instrumentprice_modified"),
|
|
39
|
+
]
|
|
40
|
+
if apps.is_installed("wbfdm")
|
|
41
|
+
else [("wbnews", "0006_alter_news_language")]
|
|
42
|
+
)
|
|
43
|
+
operations = [migrations.RunPython(migrate_content_type)]
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Generated by Django 5.0.3 on 2024-04-11 08:24
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
dependencies = [
|
|
8
|
+
("wbnews", "0007_auto_20240103_0955"),
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
operations = [
|
|
12
|
+
migrations.AlterField(
|
|
13
|
+
model_name="news",
|
|
14
|
+
name="language",
|
|
15
|
+
field=models.CharField(
|
|
16
|
+
blank=True,
|
|
17
|
+
choices=[
|
|
18
|
+
("af", "Afrikaans"),
|
|
19
|
+
("ar", "Arabic"),
|
|
20
|
+
("ar-dz", "Algerian Arabic"),
|
|
21
|
+
("ast", "Asturian"),
|
|
22
|
+
("az", "Azerbaijani"),
|
|
23
|
+
("bg", "Bulgarian"),
|
|
24
|
+
("be", "Belarusian"),
|
|
25
|
+
("bn", "Bengali"),
|
|
26
|
+
("br", "Breton"),
|
|
27
|
+
("bs", "Bosnian"),
|
|
28
|
+
("ca", "Catalan"),
|
|
29
|
+
("ckb", "Central Kurdish (Sorani)"),
|
|
30
|
+
("cs", "Czech"),
|
|
31
|
+
("cy", "Welsh"),
|
|
32
|
+
("da", "Danish"),
|
|
33
|
+
("de", "German"),
|
|
34
|
+
("dsb", "Lower Sorbian"),
|
|
35
|
+
("el", "Greek"),
|
|
36
|
+
("en", "English"),
|
|
37
|
+
("en-au", "Australian English"),
|
|
38
|
+
("en-gb", "British English"),
|
|
39
|
+
("eo", "Esperanto"),
|
|
40
|
+
("es", "Spanish"),
|
|
41
|
+
("es-ar", "Argentinian Spanish"),
|
|
42
|
+
("es-co", "Colombian Spanish"),
|
|
43
|
+
("es-mx", "Mexican Spanish"),
|
|
44
|
+
("es-ni", "Nicaraguan Spanish"),
|
|
45
|
+
("es-ve", "Venezuelan Spanish"),
|
|
46
|
+
("et", "Estonian"),
|
|
47
|
+
("eu", "Basque"),
|
|
48
|
+
("fa", "Persian"),
|
|
49
|
+
("fi", "Finnish"),
|
|
50
|
+
("fr", "French"),
|
|
51
|
+
("fy", "Frisian"),
|
|
52
|
+
("ga", "Irish"),
|
|
53
|
+
("gd", "Scottish Gaelic"),
|
|
54
|
+
("gl", "Galician"),
|
|
55
|
+
("he", "Hebrew"),
|
|
56
|
+
("hi", "Hindi"),
|
|
57
|
+
("hr", "Croatian"),
|
|
58
|
+
("hsb", "Upper Sorbian"),
|
|
59
|
+
("hu", "Hungarian"),
|
|
60
|
+
("hy", "Armenian"),
|
|
61
|
+
("ia", "Interlingua"),
|
|
62
|
+
("id", "Indonesian"),
|
|
63
|
+
("ig", "Igbo"),
|
|
64
|
+
("io", "Ido"),
|
|
65
|
+
("is", "Icelandic"),
|
|
66
|
+
("it", "Italian"),
|
|
67
|
+
("ja", "Japanese"),
|
|
68
|
+
("ka", "Georgian"),
|
|
69
|
+
("kab", "Kabyle"),
|
|
70
|
+
("kk", "Kazakh"),
|
|
71
|
+
("km", "Khmer"),
|
|
72
|
+
("kn", "Kannada"),
|
|
73
|
+
("ko", "Korean"),
|
|
74
|
+
("ky", "Kyrgyz"),
|
|
75
|
+
("lb", "Luxembourgish"),
|
|
76
|
+
("lt", "Lithuanian"),
|
|
77
|
+
("lv", "Latvian"),
|
|
78
|
+
("mk", "Macedonian"),
|
|
79
|
+
("ml", "Malayalam"),
|
|
80
|
+
("mn", "Mongolian"),
|
|
81
|
+
("mr", "Marathi"),
|
|
82
|
+
("ms", "Malay"),
|
|
83
|
+
("my", "Burmese"),
|
|
84
|
+
("nb", "Norwegian Bokmål"),
|
|
85
|
+
("ne", "Nepali"),
|
|
86
|
+
("nl", "Dutch"),
|
|
87
|
+
("nn", "Norwegian Nynorsk"),
|
|
88
|
+
("os", "Ossetic"),
|
|
89
|
+
("pa", "Punjabi"),
|
|
90
|
+
("pl", "Polish"),
|
|
91
|
+
("pt", "Portuguese"),
|
|
92
|
+
("pt-br", "Brazilian Portuguese"),
|
|
93
|
+
("ro", "Romanian"),
|
|
94
|
+
("ru", "Russian"),
|
|
95
|
+
("sk", "Slovak"),
|
|
96
|
+
("sl", "Slovenian"),
|
|
97
|
+
("sq", "Albanian"),
|
|
98
|
+
("sr", "Serbian"),
|
|
99
|
+
("sr-latn", "Serbian Latin"),
|
|
100
|
+
("sv", "Swedish"),
|
|
101
|
+
("sw", "Swahili"),
|
|
102
|
+
("ta", "Tamil"),
|
|
103
|
+
("te", "Telugu"),
|
|
104
|
+
("tg", "Tajik"),
|
|
105
|
+
("th", "Thai"),
|
|
106
|
+
("tk", "Turkmen"),
|
|
107
|
+
("tr", "Turkish"),
|
|
108
|
+
("tt", "Tatar"),
|
|
109
|
+
("udm", "Udmurt"),
|
|
110
|
+
("ug", "Uyghur"),
|
|
111
|
+
("uk", "Ukrainian"),
|
|
112
|
+
("ur", "Urdu"),
|
|
113
|
+
("uz", "Uzbek"),
|
|
114
|
+
("vi", "Vietnamese"),
|
|
115
|
+
("zh-hans", "Simplified Chinese"),
|
|
116
|
+
("zh-hant", "Traditional Chinese"),
|
|
117
|
+
],
|
|
118
|
+
max_length=16,
|
|
119
|
+
null=True,
|
|
120
|
+
verbose_name="Language",
|
|
121
|
+
),
|
|
122
|
+
),
|
|
123
|
+
]
|