-
Notifications
You must be signed in to change notification settings - Fork 121
Expand file tree
/
Copy pathmodels.py
More file actions
742 lines (575 loc) · 22.4 KB
/
Copy pathmodels.py
File metadata and controls
742 lines (575 loc) · 22.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
import uuid
from django.db import models
from django.utils.translation import gettext_lazy
from modelcluster.fields import ParentalKey, ParentalManyToManyField
from modelcluster.models import ClusterableModel
from wagtail import VERSION as WAGTAIL_VERSION
from wagtail import blocks
from wagtail.admin.panels import (
FieldPanel,
InlinePanel,
ObjectList,
PageChooserPanel,
TabbedInterface,
)
from wagtail.blocks import StructBlock
from wagtail.documents.blocks import DocumentChooserBlock
from wagtail.embeds.blocks import EmbedBlock
from wagtail.fields import RichTextField, StreamField
from wagtail.images.blocks import ImageChooserBlock
from wagtail.models import (
DraftStateMixin,
Orderable,
Page,
RevisionMixin,
TranslatableMixin,
)
from wagtail.snippets.blocks import SnippetChooserBlock
from wagtail.snippets.models import register_snippet
from wagtail_localize.components import register_translation_component
from wagtail_localize.fields import SynchronizedField, TranslatableField
from wagtail_localize.models import TranslationSource
from wagtail_localize.segments import StringSegmentValue
try:
from wagtail.admin import telepath
except ImportError: # Wagtail <7.1
from wagtail import telepath
if WAGTAIL_VERSION >= (6, 3):
from wagtail.images.blocks import ImageBlock
else:
class ImageBlock(StructBlock):
image = ImageChooserBlock(required=True)
decorative = blocks.BooleanBlock(
default=False, required=False, label=gettext_lazy("Image is decorative")
)
alt_text = blocks.CharBlock(required=False, label=gettext_lazy("Alt text"))
@register_snippet
class TestSnippet(TranslatableMixin, DraftStateMixin, RevisionMixin, ClusterableModel):
field = models.TextField(gettext_lazy("field"))
# To test field level validation of snippets
small_charfield = models.CharField(max_length=10, blank=True)
translatable_fields = [
TranslatableField("field"),
TranslatableField("small_charfield"),
TranslatableField("test_snippet_orderable"),
]
panels = [
FieldPanel("field"),
FieldPanel("small_charfield"),
InlinePanel("test_snippet_orderable"),
]
class TestNoDraftModel(TranslatableMixin):
field = models.CharField(max_length=20, blank=True)
translatable_fields = [
TranslatableField("field"),
]
panels = [
FieldPanel("field"),
]
class TestRevisionsButNoDraftModel(TranslatableMixin, RevisionMixin):
field = models.CharField(max_length=20, blank=True)
translatable_fields = [
TranslatableField("field"),
]
panels = [
FieldPanel("field"),
]
class TestSnippetOrderable(TranslatableMixin, Orderable):
parent = ParentalKey(
"TestSnippet",
related_name="test_snippet_orderable",
)
orderable_text = models.CharField(max_length=30, null=False, blank=False)
orderable_page = models.ForeignKey(
Page,
blank=True,
null=True,
related_name="+",
on_delete=models.CASCADE,
)
panels = [
PageChooserPanel("orderable_page"),
FieldPanel("orderable_text"),
]
class TestUUIDModel(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
charfield = models.CharField(max_length=10, blank=True)
def __str__(self):
return f"TestUUIDModel: {self.id}"
@register_snippet
class TestUUIDSnippet(TranslatableMixin, models.Model):
field = models.ForeignKey(TestUUIDModel, on_delete=models.CASCADE)
translatable_fields = [SynchronizedField("field")]
def __str__(self):
return f"TestUUIDModel: {self.field_id}"
@register_snippet
class TestParentalSnippet(TranslatableMixin, ClusterableModel):
field = ParentalManyToManyField(
TestUUIDModel,
blank=True,
)
translatable_fields = [SynchronizedField("field")]
@register_snippet
class NonTranslatableSnippet(models.Model):
field = models.TextField()
def __str__(self):
return self.field
class TestStructBlock(blocks.StructBlock):
field_a = blocks.TextBlock()
field_b = blocks.TextBlock()
class TestChooserStructBlock(blocks.StructBlock):
page = blocks.PageChooserBlock()
class TestNestedStreamBlock(blocks.StreamBlock):
block_a = blocks.TextBlock()
block_b = blocks.TextBlock()
block_l = blocks.ListBlock(blocks.CharBlock())
chooser = blocks.PageChooserBlock()
chooser_in_struct = TestChooserStructBlock()
chooser_in_list = blocks.ListBlock(blocks.PageChooserBlock())
class TestNestedChooserStructBlock(blocks.StructBlock):
nested_page = TestChooserStructBlock()
class TestStreamBlockInStructBlock(blocks.StructBlock):
nested_stream = blocks.StreamBlock(
[("page", blocks.PageChooserBlock()), ("checklist", TestChooserStructBlock())]
)
class CustomStructBlock(blocks.StructBlock):
field_a = blocks.TextBlock()
field_b = blocks.TextBlock()
def get_translatable_segments(self, value):
return [
StringSegmentValue(
"foo", "{} / {}".format(value["field_a"], value["field_b"])
)
]
def restore_translated_segments(self, value, segments):
for segment in segments:
if segment.path == "foo":
field_a, field_b = segment.render_text().split("/")
value["field_a"] = field_a.strip()
value["field_b"] = field_b.strip()
return value
class CustomBlockWithoutExtractMethod(blocks.Block):
def render_form(self, *args, **kwargs):
"""Placeholder for Wagtail < 2.13"""
return ""
class Meta:
default = None
class LinksList(blocks.StructBlock):
heading = blocks.CharBlock(label="List Heading", blank=True, required=False)
pages = blocks.ListBlock(blocks.PageChooserBlock())
class ListStructBlock(blocks.StructBlock):
title = blocks.CharBlock(required=False)
items = blocks.ListBlock(blocks.CharBlock)
links_list = blocks.ListBlock(LinksList())
class CustomBlockWithoutExtractMethodAdapter(telepath.Adapter):
js_constructor = "CustomBlockWithoutExtractMethod"
def js_args(self, block):
return []
telepath.register(
CustomBlockWithoutExtractMethodAdapter(), CustomBlockWithoutExtractMethod
)
class ImageBlockInStructBlock(StructBlock):
the_image = ImageBlock(required=False)
class ImageBlockInListBlock(blocks.ListBlock):
def __init__(self, search_index=True, **kwargs):
super().__init__(ImageBlock, search_index=search_index, **kwargs)
class ImageBlockInStreamBlock(blocks.StreamBlock):
the_image = ImageBlock()
class TestStreamBlock(blocks.StreamBlock):
test_charblock = blocks.CharBlock(max_length=255)
test_textblock = blocks.TextBlock(label=gettext_lazy("text block"))
test_emailblock = blocks.EmailBlock()
test_urlblock = blocks.URLBlock()
test_richtextblock = blocks.RichTextBlock()
test_rawhtmlblock = blocks.RawHTMLBlock()
test_blockquoteblock = blocks.BlockQuoteBlock()
test_structblock = TestStructBlock()
test_listblock = blocks.ListBlock(blocks.TextBlock())
test_listblock_in_structblock = ListStructBlock()
test_nestedstreamblock = TestNestedStreamBlock()
test_streamblock_in_structblock = TestStreamBlockInStructBlock()
test_customstructblock = CustomStructBlock()
test_customblockwithoutextractmethod = CustomBlockWithoutExtractMethod()
test_pagechooserblock = blocks.PageChooserBlock()
test_pagechooserblock_with_restricted_types = blocks.PageChooserBlock(
["wagtail_localize_test.TestHomePage", "wagtail_localize_test.TestPage"]
)
test_imagechooserblock = ImageChooserBlock()
test_documentchooserblock = DocumentChooserBlock()
test_snippetchooserblock = SnippetChooserBlock(TestSnippet)
test_nontranslatablesnippetchooserblock = SnippetChooserBlock(
NonTranslatableSnippet
)
test_embedblock = EmbedBlock()
test_chooserstructblock = TestChooserStructBlock()
test_nestedchooserstructblock = TestNestedChooserStructBlock()
test_chooser_in_struct_in_listblock = blocks.ListBlock(
blocks.StructBlock(
[
("page", blocks.PageChooserBlock(required=False)),
]
)
)
test_image_chooser_in_listblock = blocks.ListBlock(
ImageChooserBlock(),
)
test_document_chooser_in_listblock = blocks.ListBlock(
DocumentChooserBlock(),
)
# chooser in struct in list in stream in listblock
test_chooser_in_struct_in_list_in_stream_in_listblock = blocks.ListBlock(
blocks.StreamBlock(
[
(
"list",
blocks.ListBlock(
blocks.StructBlock(
[
("page", blocks.PageChooserBlock(required=False)),
]
)
),
),
]
)
)
test_imageblock = ImageBlock()
test_imageblock_in_structblock = ImageBlockInStructBlock()
test_imageblock_in_listblock = ImageBlockInListBlock()
test_imageblock_in_streamblock = ImageBlockInStreamBlock()
class TestCustomField(models.TextField):
def get_translatable_segments(self, value):
if not value:
# Don't disrupt other tests
return []
return [StringSegmentValue("foo", f"{value} and some extra")]
class TestPage(Page):
test_charfield = models.CharField( # noqa: DJ001
gettext_lazy("char field"), max_length=255, blank=True, null=True, default=""
)
test_textfield = models.TextField(blank=True)
test_emailfield = models.EmailField(blank=True)
test_slugfield = models.SlugField(blank=True)
test_urlfield = models.URLField(blank=True)
test_richtextfield = RichTextField(blank=True)
test_null_richtextfield = RichTextField(blank=True, null=True)
test_streamfield = StreamField(TestStreamBlock, blank=True, use_json_field=True)
test_snippet = models.ForeignKey(
TestSnippet, null=True, blank=True, on_delete=models.SET_NULL
)
test_customfield = TestCustomField(blank=True)
test_synchronized_charfield = models.CharField(max_length=255, blank=True)
test_synchronized_textfield = models.TextField(blank=True)
test_not_overridable_synchronized_textfield = models.TextField(blank=True)
test_synchronized_emailfield = models.EmailField(blank=True)
test_synchronized_slugfield = models.SlugField(blank=True)
test_synchronized_urlfield = models.URLField(blank=True)
test_synchronized_richtextfield = RichTextField(blank=True)
test_synchronized_streamfield = StreamField(
TestStreamBlock, blank=True, use_json_field=True
)
test_synchronized_image = models.ForeignKey(
"wagtailimages.Image",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="+",
)
test_synchronized_document = models.ForeignKey(
"wagtaildocs.Document",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="+",
)
test_synchronized_snippet = models.ForeignKey(
TestSnippet, null=True, blank=True, on_delete=models.SET_NULL, related_name="+"
)
test_page = models.ForeignKey(
Page, null=True, blank=True, on_delete=models.SET_NULL, related_name="+"
)
test_page_specific_type = models.ForeignKey(
"TestHomePage",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="+",
)
test_page_with_restricted_types = models.ForeignKey(
Page, null=True, blank=True, on_delete=models.SET_NULL, related_name="+"
)
test_synchronized_customfield = TestCustomField(blank=True)
translatable_fields = [
TranslatableField("test_charfield"),
TranslatableField("test_textfield"),
TranslatableField("test_emailfield"),
TranslatableField("test_slugfield"),
TranslatableField("test_urlfield"),
TranslatableField("test_richtextfield"),
TranslatableField("test_null_richtextfield"),
TranslatableField("test_streamfield"),
TranslatableField("test_snippet"),
TranslatableField("test_childobjects"),
TranslatableField("test_customfield"),
SynchronizedField("test_synchronized_charfield"),
SynchronizedField("test_synchronized_textfield"),
SynchronizedField(
"test_not_overridable_synchronized_textfield", overridable=False
),
SynchronizedField("test_synchronized_emailfield"),
SynchronizedField("test_synchronized_slugfield"),
SynchronizedField("test_synchronized_urlfield"),
SynchronizedField("test_synchronized_richtextfield"),
SynchronizedField("test_synchronized_streamfield"),
SynchronizedField("test_synchronized_image"),
SynchronizedField("test_synchronized_document"),
SynchronizedField("test_synchronized_snippet"),
SynchronizedField("test_synchronized_childobjects"),
SynchronizedField("test_page"),
SynchronizedField("test_page_specific_type"),
SynchronizedField("test_page_with_restricted_types"),
SynchronizedField("test_synchronized_customfield"),
]
content_panels = Page.content_panels + [
FieldPanel("test_charfield"),
FieldPanel("test_textfield"),
FieldPanel("test_emailfield"),
FieldPanel("test_slugfield"),
FieldPanel("test_urlfield"),
FieldPanel("test_richtextfield"),
FieldPanel("test_streamfield"),
FieldPanel("test_snippet"),
InlinePanel("test_childobjects"),
FieldPanel("test_customfield"),
FieldPanel("test_synchronized_charfield"),
FieldPanel("test_synchronized_textfield"),
FieldPanel("test_synchronized_emailfield"),
FieldPanel("test_synchronized_slugfield"),
FieldPanel("test_synchronized_urlfield"),
FieldPanel("test_synchronized_richtextfield"),
FieldPanel("test_synchronized_streamfield"),
FieldPanel("test_synchronized_image"),
FieldPanel("test_synchronized_document"),
FieldPanel("test_synchronized_snippet"),
InlinePanel("test_synchronized_childobjects"),
PageChooserPanel("test_page"),
PageChooserPanel("test_page_specific_type"),
PageChooserPanel(
"test_page_with_restricted_types",
["wagtail_localize_test.TestHomePage", "wagtail_localize_test.TestPage"],
),
FieldPanel("test_synchronized_customfield"),
]
class TestWithTranslationModeDisabledPage(Page):
# Always keep the translation mode off, regardless of the global
# WAGTAIL_LOCALIZE_DEFAULT_TRANSLATION_MODE value
localize_default_translation_mode = "simple"
class TestWithTranslationModeEnabledPage(Page):
# Always keep the translation mode on, regardless of the global
# WAGTAIL_LOCALIZE_DEFAULT_TRANSLATION_MODE value
localize_default_translation_mode = "synced"
class TestModel(TranslatableMixin):
title = models.CharField(max_length=255)
test_charfield = models.CharField(max_length=255, blank=True)
test_textfield = models.TextField(blank=True)
test_emailfield = models.EmailField(blank=True)
translatable_fields = [
TranslatableField("test_charfield"),
TranslatableField("test_textfield"),
TranslatableField("test_emailfield"),
]
class NonTranslatableModel(models.Model):
title = models.CharField(max_length=255, blank=True)
def __str__(self):
return self.title
class InheritedTestModel(TestModel):
class Meta:
unique_together = None
class TestChildObject(TranslatableMixin, Orderable):
page = ParentalKey(TestPage, related_name="test_childobjects")
field = models.TextField()
translatable_fields = [TranslatableField("field")]
class Meta(TranslatableMixin.Meta, Orderable.Meta):
pass
# TODO: System check for TranslatableMixin here
class TestSynchronizedChildObject(Orderable):
page = ParentalKey(TestPage, related_name="test_synchronized_childobjects")
field = models.TextField()
translatable_fields = [TranslatableField("field")]
# FIXME: Rename me
class TestNonParentalChildObject(TranslatableMixin, Orderable):
page = models.ForeignKey(
TestPage,
on_delete=models.CASCADE,
related_name="test_nonparentalchildobjects", # FIXME: inconsistent related_name
)
field = models.TextField()
translatable_fields = [TranslatableField("field")]
class TestHomePage(Page):
pass
class TestGenerateTranslatableFieldsPage(Page):
"""
A page type that tests the builtin automatic generation of translatable fields.
"""
test_charfield = models.CharField(max_length=255, blank=True)
test_charfield_with_choices = models.CharField(
max_length=255, blank=True, choices=[("a", "A"), ("b", "B")]
)
test_textfield = models.TextField(blank=True)
test_emailfield = models.EmailField(blank=True)
test_slugfield = models.SlugField(blank=True)
test_urlfield = models.URLField(blank=True)
test_richtextfield = RichTextField(blank=True)
test_streamfield = StreamField(TestStreamBlock, blank=True, use_json_field=True)
test_snippet = models.ForeignKey(
TestSnippet, null=True, blank=True, on_delete=models.SET_NULL
)
test_nontranslatablesnippet = models.ForeignKey(
NonTranslatableSnippet,
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="+",
)
test_customfield = TestCustomField(blank=True)
class TestOverrideTranslatableFieldsPage(TestGenerateTranslatableFieldsPage):
override_translatable_fields = [
SynchronizedField("test_charfield"),
TranslatableField("test_emailfield"),
]
class TranslatableChildObject(TranslatableMixin, Orderable):
page = ParentalKey(
TestGenerateTranslatableFieldsPage,
related_name="test_translatable_childobjects",
)
field = models.TextField()
class Meta(TranslatableMixin.Meta, Orderable.Meta):
pass
class NonTranslatableChildObject(Orderable):
page = ParentalKey(
TestGenerateTranslatableFieldsPage,
related_name="test_nontranslatable_childobjects",
)
field = models.TextField()
def __str__(self):
return f"NonTranslatableChildObject ({self.pk}: {self.page_id}"
class TestModelWithInvalidForeignKey(TranslatableMixin, models.Model):
fk = models.ForeignKey("wagtailcore.Site", on_delete=models.CASCADE)
# This should raise an error as the model being pointed to is not
# translatable!
translatable_fields = [
TranslatableField("fk"),
]
def __str__(self):
return (
f"TestModelWithInvalidForeignKey ({self.pk}: {self.fk_id}, {self.locale_id}"
)
class PageWithCustomEditHandler(Page):
foo_field = models.TextField()
bar_field = models.TextField()
baz_field = models.TextField()
foo_panels = [
FieldPanel("foo_field"),
]
bar_panels = [
FieldPanel("bar_field"),
FieldPanel("baz_field"),
]
edit_handler = TabbedInterface(
[
ObjectList(bar_panels, heading="Bar"),
ObjectList([InlinePanel("child_objects")], heading="Child objects"),
ObjectList(foo_panels, heading="Foo"),
ObjectList(Page.content_panels, heading="Content"),
ObjectList(Page.promote_panels, heading="Promote"),
ObjectList(Page.settings_panels, heading="Settings"),
]
)
class PageWithCustomEditHandlerChildObject(TranslatableMixin, Orderable):
page = ParentalKey(PageWithCustomEditHandler, related_name="child_objects")
field = models.TextField()
class Meta(TranslatableMixin.Meta, Orderable.Meta):
pass
def __str__(self):
return f"PageWithCustomEditHandlerChildObject ({self.pk}: {self.page_id}"
@register_translation_component(
heading="Custom translation view component",
help_text="This is the component help text",
enable_text="Add custom data",
disable_text="Do not send add custom data",
)
class CustomTranslationData(models.Model):
translation_source = models.ForeignKey(
TranslationSource, on_delete=models.CASCADE, editable=False
)
custom_text_field = models.CharField(max_length=255)
def __str__(self):
return f"CustomTranslationData ({self.pk}: {self.translation_source_id})"
@classmethod
def get_or_create_from_source_and_translation_data(
cls, translation_source, translations, **kwargs
):
custom_data, created = CustomTranslationData.objects.get_or_create(
translation_source=translation_source, **kwargs
)
return custom_data, created
@register_translation_component(
heading="Notes",
enable_text="Add notes",
disable_text="Do not add notes",
)
class CustomButSimpleTranslationData(models.Model):
notes = models.CharField(max_length=255)
def __str__(self):
return f"CustomButSimpleTranslationData ({self.pk})"
class SubNavigationLink(Orderable, TranslatableMixin):
sub_nav = ParentalKey(
"wagtail_localize_test.NavigationLink",
on_delete=models.CASCADE,
related_name="sub_navigation_links",
null=True,
)
label = models.CharField(max_length=255)
page = models.ForeignKey(
"wagtailcore.Page",
null=True,
on_delete=models.SET_NULL,
related_name="+",
blank=True,
)
panels = [
FieldPanel("label"),
PageChooserPanel("page"),
]
class Meta(TranslatableMixin.Meta):
pass
class NavigationLink(ClusterableModel, Orderable, TranslatableMixin):
snippet = ParentalKey(
"wagtail_localize_test.Header",
on_delete=models.CASCADE,
related_name="navigation_links",
)
label = models.CharField(max_length=255)
page = models.ForeignKey(
Page, null=True, on_delete=models.SET_NULL, related_name="+", blank=True
)
panels = [
FieldPanel("label"),
PageChooserPanel("page"),
InlinePanel("sub_navigation_links", heading="Sub navigation"),
]
class Meta(TranslatableMixin.Meta):
pass
def __str__(self) -> str:
return self.label
@register_snippet
class Header(ClusterableModel, TranslatableMixin):
name = models.CharField(max_length=100, blank=True)
panels = [
FieldPanel("name"),
InlinePanel("navigation_links", heading="Main navigation"),
]
def __str__(self):
return self.name
class Meta(TranslatableMixin.Meta):
pass