1- # Generated by Django 6.0.2 on 2026-02-19 22:22
1+ # Generated by Django 6.0.2 on 2026-02-27 21:21
22
33import django .db .models .deletion
4+ import modelcluster .contrib .taggit
45import modelcluster .fields
5- import pages .mixins
6- import wagtail .contrib .routable_page .models
6+ import wagtail .fields
77from django .db import migrations , models
88
99
@@ -13,6 +13,7 @@ class Migration(migrations.Migration):
1313
1414 dependencies = [
1515 ("wagtailcore" , "0096_referenceindex_referenceindex_source_object_and_more" ),
16+ ("wagtailimages" , "0027_image_description" ),
1617 ]
1718
1819 operations = [
@@ -47,6 +48,39 @@ class Migration(migrations.Migration):
4748 "verbose_name_plural" : "content tags" ,
4849 },
4950 ),
51+ migrations .CreateModel (
52+ name = "TaggedContent" ,
53+ fields = [
54+ (
55+ "id" ,
56+ models .AutoField (
57+ auto_created = True ,
58+ primary_key = True ,
59+ serialize = False ,
60+ verbose_name = "ID" ,
61+ ),
62+ ),
63+ (
64+ "content_object" ,
65+ modelcluster .fields .ParentalKey (
66+ on_delete = django .db .models .deletion .CASCADE ,
67+ related_name = "tagged_items" ,
68+ to = "wagtailcore.page" ,
69+ ),
70+ ),
71+ (
72+ "tag" ,
73+ models .ForeignKey (
74+ on_delete = django .db .models .deletion .CASCADE ,
75+ related_name = "tagged_content" ,
76+ to = "pages.contenttag" ,
77+ ),
78+ ),
79+ ],
80+ options = {
81+ "abstract" : False ,
82+ },
83+ ),
5084 migrations .CreateModel (
5185 name = "RoutableHomePage" ,
5286 fields = [
@@ -61,48 +95,128 @@ class Migration(migrations.Migration):
6195 to = "wagtailcore.page" ,
6296 ),
6397 ),
98+ (
99+ "tags" ,
100+ modelcluster .contrib .taggit .ClusterTaggableManager (
101+ blank = True ,
102+ help_text = "A comma-separated list of tags." ,
103+ through = "pages.TaggedContent" ,
104+ to = "pages.ContentTag" ,
105+ verbose_name = "Tags" ,
106+ ),
107+ ),
64108 ],
65109 options = {
66110 "abstract" : False ,
67111 },
68- bases = (
69- wagtail .contrib .routable_page .models .RoutablePageMixin ,
70- pages .mixins .FlaggedMixin ,
71- pages .mixins .TaggableMixin ,
72- "wagtailcore.page" ,
73- ),
112+ bases = ("wagtailcore.page" ,),
74113 ),
75114 migrations .CreateModel (
76- name = "TaggedContent " ,
115+ name = "PostPage " ,
77116 fields = [
78117 (
79- "id " ,
80- models .AutoField (
118+ "page_ptr " ,
119+ models .OneToOneField (
81120 auto_created = True ,
121+ on_delete = django .db .models .deletion .CASCADE ,
122+ parent_link = True ,
82123 primary_key = True ,
83124 serialize = False ,
84- verbose_name = "ID " ,
125+ to = "wagtailcore.page " ,
85126 ),
86127 ),
87128 (
88- "content_object" ,
89- modelcluster .fields .ParentalKey (
90- on_delete = django .db .models .deletion .CASCADE ,
91- related_name = "tagged_items" ,
92- to = "wagtailcore.page" ,
129+ "content" ,
130+ wagtail .fields .StreamField (
131+ [
132+ ("rich_text" , 0 ),
133+ ("markdown" , 1 ),
134+ ("url" , 2 ),
135+ ("video" , 5 ),
136+ ("poll" , 7 ),
137+ ],
138+ block_lookup = {
139+ 0 : ("wagtail.blocks.RichTextBlock" , (), {}),
140+ 1 : ("wagtailmarkdown.blocks.MarkdownBlock" , (), {}),
141+ 2 : ("wagtail.blocks.URLBlock" , (), {}),
142+ 3 : ("wagtail.embeds.blocks.EmbedBlock" , (), {}),
143+ 4 : ("wagtail.images.blocks.ImageChooserBlock" , (), {}),
144+ 5 : (
145+ "wagtail.blocks.StructBlock" ,
146+ [[("video" , 3 ), ("thumbnail" , 4 )]],
147+ {"label" : "Video" },
148+ ),
149+ 6 : ("wagtail.blocks.CharBlock" , (), {"max_length" : 200 }),
150+ 7 : (
151+ "wagtail.blocks.StreamBlock" ,
152+ [[("poll_choice" , 6 )]],
153+ {},
154+ ),
155+ },
93156 ),
94157 ),
95158 (
96- "tag" ,
159+ "summary" ,
160+ models .TextField (
161+ blank = True ,
162+ default = "" ,
163+ help_text = "AI generated summary. Delete to regenerate." ,
164+ ),
165+ ),
166+ (
167+ "image" ,
97168 models .ForeignKey (
169+ blank = True ,
170+ null = True ,
171+ on_delete = django .db .models .deletion .SET_NULL ,
172+ related_name = "+" ,
173+ to = "wagtailimages.image" ,
174+ ),
175+ ),
176+ (
177+ "tags" ,
178+ modelcluster .contrib .taggit .ClusterTaggableManager (
179+ blank = True ,
180+ help_text = "A comma-separated list of tags." ,
181+ through = "pages.TaggedContent" ,
182+ to = "pages.ContentTag" ,
183+ verbose_name = "Tags" ,
184+ ),
185+ ),
186+ ],
187+ options = {
188+ "abstract" : False ,
189+ },
190+ bases = ("wagtailcore.page" ,),
191+ ),
192+ migrations .CreateModel (
193+ name = "PostIndexPage" ,
194+ fields = [
195+ (
196+ "page_ptr" ,
197+ models .OneToOneField (
198+ auto_created = True ,
98199 on_delete = django .db .models .deletion .CASCADE ,
99- related_name = "tagged_content" ,
100- to = "pages.contenttag" ,
200+ parent_link = True ,
201+ primary_key = True ,
202+ serialize = False ,
203+ to = "wagtailcore.page" ,
204+ ),
205+ ),
206+ (
207+ "tags" ,
208+ modelcluster .contrib .taggit .ClusterTaggableManager (
209+ blank = True ,
210+ help_text = "A comma-separated list of tags." ,
211+ through = "pages.TaggedContent" ,
212+ to = "pages.ContentTag" ,
213+ verbose_name = "Tags" ,
101214 ),
102215 ),
103216 ],
104217 options = {
105218 "abstract" : False ,
106219 },
220+ bases = ("wagtailcore.page" ,),
107221 ),
108222 ]
0 commit comments