class TradingBlocTaggedCaseStudy(ItemBase): tag = models.ForeignKey(PersonalisationTradingBlocTag, related_name='trading_bloc_tagged_case_studies', on_delete=models.CASCADE) content_object = ParentalKey(to='core.CaseStudy', on_delete=models.CASCADE, related_name='trading_bloc_tagged_items')
class AccordionEntry(Orderable): accordion_page = ParentalKey(to=AccordionPage, on_delete=models.CASCADE, related_name='entry') header_de = models.CharField(max_length=128) header_it = models.CharField(max_length=128) body_de = RichTextField( blank=True, default="", features=['h2', 'h3', 'bold', 'italic', 'ol', 'ul', 'hr', 'link']) body_it = RichTextField( blank=True, default="", features=['h2', 'h3', 'bold', 'italic', 'ol', 'ul', 'hr', 'link']) header = TranslatedField( 'header_de', 'header_it', ) body = TranslatedField( 'body_de', 'body_it', ) show_in_menus_default = True def __str__(self) -> str: return self.header
class FormField(CustomAbstractFormField): page = ParentalKey( 'ContactPage', on_delete=models.CASCADE, related_name='form_fields', )
class ProjectItem(Orderable): """Project Item to show in the carousel""" page = ParentalKey(AboutPage, on_delete=models.CASCADE, related_name="projects") name = models.CharField(max_length=255, blank=False, null=True) project_url = models.URLField(blank=True, null=True) snapshot = models.ForeignKey( "wagtailimages.Image", on_delete=models.SET_NULL, related_name="+", blank=False, null=True, ) panels = [ FieldPanel('name'), FieldPanel('project_url'), ImageChooserPanel('snapshot'), ] class Meta: # noqa verbose_name = "Side Project" verbose_name_plural = "Side Projects" def __str__(self): return self.name
class HSCodeTaggedCaseStudy(ItemBase): tag = models.ForeignKey(PersonalisationHSCodeTag, related_name='hscode_tagged_case_studies', on_delete=models.CASCADE) content_object = ParentalKey(to='core.CaseStudy', on_delete=models.CASCADE, related_name='hs_code_tagged_items')
class HomePageImage(Orderable): page = ParentalKey(HomePage, on_delete=models.CASCADE, related_name='home_page_images') image = models.ForeignKey( 'wagtailimages.Image', on_delete=models.SET_NULL, related_name='+', null=True, blank=True, ) panels = [ImageChooserPanel('image')]
class TourStep(Orderable): title = models.CharField(max_length=255) body = models.CharField(max_length=255) position = models.CharField(max_length=255) selector = models.CharField(max_length=255) tour = ParentalKey(Tour, on_delete=models.CASCADE, related_name='steps') panels = [ FieldPanel('title'), FieldPanel('body'), FieldPanel('position'), FieldPanel('selector'), ]
class ExpertiseClient(Orderable, models.Model): page = ParentalKey('studio.Expertise', on_delete=models.CASCADE, related_name='expertise_client') client = models.ForeignKey('core.Client', on_delete=models.CASCADE, related_name='+') class Meta: verbose_name = 'Client' verbose_name_plural = 'Clients' panels = [SnippetChooserPanel('client')]
class FooterLink(Orderable): footer = ParentalKey(to=Footer, on_delete=models.CASCADE, related_name='footer_link') url = models.URLField(max_length=255) text = models.CharField(max_length=255) panels = [ FieldPanel('url'), FieldPanel('text'), ] def __str__(self) -> str: return self.text
class ExpertiseHero(Banner): page = ParentalKey('studio.Expertise', on_delete=models.SET_NULL, blank=True, null=True, related_name='expertise_hero') caption = models.CharField(max_length=255, blank=True, null=True) cover_image = models.ForeignKey('wagtailimages.Image', on_delete=models.SET_NULL, blank=True, null=True, related_name='+') panels = [FieldPanel('caption'), ImageChooserPanel('cover_image')] + Banner.panels
class FooterImage(Orderable): footer = ParentalKey(to=Footer, on_delete=models.CASCADE, related_name='footer_image') url = models.URLField(max_length=255) image = models.ForeignKey( 'wagtailimages.Image', on_delete=models.SET_NULL, related_name='+', null=True, blank=True, ) panels = [ FieldPanel('url'), ImageChooserPanel('image'), ] def __str__(self) -> str: return str(self.url)
class CaseStudyRelatedPages(Orderable): case_study = ParentalKey( 'core.CaseStudy', related_name='related_pages', on_delete=models.SET_NULL, null=True, blank=True, ) page = models.ForeignKey('wagtailcore.Page', blank=True, null=True, on_delete=models.SET_NULL, related_name='+') panels = [ MagnaPageChooserPanel('page', [DetailPage, CuratedListPage, TopicPage]), ] class Meta: unique_together = ['case_study', 'page']
class Message(models.Model): thread = ParentalKey(MessageThread, on_delete=models.CASCADE, related_name="thread_messages") email = models.EmailField(max_length=255) author = models.ForeignKey("wesgarlockbase.User", on_delete=models.CASCADE, blank=True, null=True) created_time = models.DateTimeField(auto_now_add=True) edited_time = models.DateTimeField(auto_now=True) reply_to = models.ForeignKey("self", on_delete=models.CASCADE, blank=True, null=True) body = models.TextField()
class BlogPageTag(TaggedItemBase): content_object = ParentalKey('PostPage', related_name='post_tags')
class ContentModuleTag(TaggedItemBase): content_object = ParentalKey('core.ContentModule', on_delete=models.CASCADE, related_name='tagged_items')
class FormField(AbstractFormField): page = ParentalKey('ContactPage', related_name='custom_form_fields')
class FormField(AbstractFormField): page = ParentalKey("ContactPage", on_delete=models.CASCADE, related_name='form_fields')
class FormField(CustomAbstractFormField): form = ParentalKey("ContactPage", on_delete=models.CASCADE, related_name="form_fields")