Skip to content

Commit 4907070

Browse files
committed
add view
1 parent 8339e37 commit 4907070

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3154
-1368
lines changed

pythonkr_backend/curation/admin.py

Lines changed: 230 additions & 140 deletions
Large diffs are not rendered by default.

pythonkr_backend/curation/apps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33

44
class CurationConfig(AppConfig):
5-
default_auto_field = 'django.db.models.BigAutoField'
6-
name = 'curation'
5+
default_auto_field = "django.db.models.BigAutoField"
6+
name = "curation"

pythonkr_backend/curation/migrations/0001_initial.py

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,47 @@
44

55

66
class Migration(migrations.Migration):
7-
87
initial = True
98

10-
dependencies = [
11-
]
9+
dependencies = []
1210

1311
operations = [
1412
migrations.CreateModel(
15-
name='Article',
13+
name="Article",
1614
fields=[
17-
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18-
('url', models.URLField(help_text='The unique URL of the article.', max_length=2048, unique=True)),
19-
('title', models.CharField(blank=True, help_text='Article title (can be fetched automatically or entered manually).', max_length=512)),
20-
('summary', models.TextField(blank=True, help_text='AI-generated summary of the article.')),
21-
('created_at', models.DateTimeField(auto_now_add=True)),
22-
('updated_at', models.DateTimeField(auto_now=True)),
15+
(
16+
"id",
17+
models.BigAutoField(
18+
auto_created=True,
19+
primary_key=True,
20+
serialize=False,
21+
verbose_name="ID",
22+
),
23+
),
24+
(
25+
"url",
26+
models.URLField(
27+
help_text="The unique URL of the article.",
28+
max_length=2048,
29+
unique=True,
30+
),
31+
),
32+
(
33+
"title",
34+
models.CharField(
35+
blank=True,
36+
help_text="Article title (can be fetched automatically or entered manually).",
37+
max_length=512,
38+
),
39+
),
40+
(
41+
"summary",
42+
models.TextField(
43+
blank=True, help_text="AI-generated summary of the article."
44+
),
45+
),
46+
("created_at", models.DateTimeField(auto_now_add=True)),
47+
("updated_at", models.DateTimeField(auto_now=True)),
2348
],
2449
),
2550
]

pythonkr_backend/curation/migrations/0002_article_reading_time_minutes.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44

55

66
class Migration(migrations.Migration):
7-
87
dependencies = [
9-
('curation', '0001_initial'),
8+
("curation", "0001_initial"),
109
]
1110

1211
operations = [
1312
migrations.AddField(
14-
model_name='article',
15-
name='reading_time_minutes',
16-
field=models.PositiveIntegerField(blank=True, help_text='Estimated reading time in minutes.', null=True),
13+
model_name="article",
14+
name="reading_time_minutes",
15+
field=models.PositiveIntegerField(
16+
blank=True, help_text="Estimated reading time in minutes.", null=True
17+
),
1718
),
1819
]

pythonkr_backend/curation/migrations/0003_article_summary_ko.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44

55

66
class Migration(migrations.Migration):
7-
87
dependencies = [
9-
('curation', '0002_article_reading_time_minutes'),
8+
("curation", "0002_article_reading_time_minutes"),
109
]
1110

1211
operations = [
1312
migrations.AddField(
14-
model_name='article',
15-
name='summary_ko',
16-
field=models.TextField(blank=True, help_text='Korean translation of the summary (via OpenAI).'),
13+
model_name="article",
14+
name="summary_ko",
15+
field=models.TextField(
16+
blank=True, help_text="Korean translation of the summary (via OpenAI)."
17+
),
1718
),
1819
]

pythonkr_backend/curation/migrations/0004_alter_article_reading_time_minutes.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@
44

55

66
class Migration(migrations.Migration):
7-
87
dependencies = [
9-
('curation', '0003_article_summary_ko'),
8+
("curation", "0003_article_summary_ko"),
109
]
1110

1211
operations = [
1312
migrations.AlterField(
14-
model_name='article',
15-
name='reading_time_minutes',
16-
field=models.PositiveIntegerField(blank=True, help_text='Estimated reading time in minutes (based on full article content).', null=True),
13+
model_name="article",
14+
name="reading_time_minutes",
15+
field=models.PositiveIntegerField(
16+
blank=True,
17+
help_text="Estimated reading time in minutes (based on full article content).",
18+
null=True,
19+
),
1720
),
1821
]

pythonkr_backend/curation/migrations/0005_category.py

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,44 @@
44

55

66
class Migration(migrations.Migration):
7-
87
dependencies = [
9-
('curation', '0004_alter_article_reading_time_minutes'),
8+
("curation", "0004_alter_article_reading_time_minutes"),
109
]
1110

1211
operations = [
1312
migrations.CreateModel(
14-
name='Category',
13+
name="Category",
1514
fields=[
16-
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
17-
('name', models.CharField(help_text="The name of the category (e.g., 'Web Development', 'LLM').", max_length=100, unique=True)),
18-
('slug', models.SlugField(blank=True, help_text='A URL-friendly slug for the category.', max_length=100, unique=True)),
15+
(
16+
"id",
17+
models.BigAutoField(
18+
auto_created=True,
19+
primary_key=True,
20+
serialize=False,
21+
verbose_name="ID",
22+
),
23+
),
24+
(
25+
"name",
26+
models.CharField(
27+
help_text="The name of the category (e.g., 'Web Development', 'LLM').",
28+
max_length=100,
29+
unique=True,
30+
),
31+
),
32+
(
33+
"slug",
34+
models.SlugField(
35+
blank=True,
36+
help_text="A URL-friendly slug for the category.",
37+
max_length=100,
38+
unique=True,
39+
),
40+
),
1941
],
2042
options={
21-
'verbose_name_plural': 'Categories',
22-
'ordering': ['name'],
43+
"verbose_name_plural": "Categories",
44+
"ordering": ["name"],
2345
},
2446
),
2547
]

pythonkr_backend/curation/migrations/0006_article_categories.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@
44

55

66
class Migration(migrations.Migration):
7-
87
dependencies = [
9-
('curation', '0005_category'),
8+
("curation", "0005_category"),
109
]
1110

1211
operations = [
1312
migrations.AddField(
14-
model_name='article',
15-
name='categories',
16-
field=models.ManyToManyField(blank=True, help_text='Select one or more categories for this article.', related_name='articles', to='curation.category'),
13+
model_name="article",
14+
name="categories",
15+
field=models.ManyToManyField(
16+
blank=True,
17+
help_text="Select one or more categories for this article.",
18+
related_name="articles",
19+
to="curation.category",
20+
),
1721
),
1822
]

0 commit comments

Comments
 (0)