コード例 #1
0
ファイル: models.py プロジェクト: uktrade/great-cms
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')
コード例 #2
0
ファイル: models.py プロジェクト: dolikemc/girotrain
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
コード例 #3
0
class FormField(CustomAbstractFormField):

    page = ParentalKey(
        'ContactPage',
        on_delete=models.CASCADE,
        related_name='form_fields',
    )
コード例 #4
0
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
コード例 #5
0
ファイル: models.py プロジェクト: uktrade/great-cms
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')
コード例 #6
0
ファイル: models.py プロジェクト: dolikemc/girotrain
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')]
コード例 #7
0
ファイル: models.py プロジェクト: uktrade/great-cms
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'),
    ]
コード例 #8
0
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')]
コード例 #9
0
ファイル: models.py プロジェクト: dolikemc/girotrain
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
コード例 #10
0
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
コード例 #11
0
ファイル: models.py プロジェクト: dolikemc/girotrain
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)
コード例 #12
0
ファイル: models.py プロジェクト: uktrade/great-cms
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']
コード例 #13
0
ファイル: _contact.py プロジェクト: wgarlock/wesgarlock
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()
コード例 #14
0
class BlogPageTag(TaggedItemBase):
    content_object = ParentalKey('PostPage', related_name='post_tags')
コード例 #15
0
ファイル: models.py プロジェクト: uktrade/great-cms
class ContentModuleTag(TaggedItemBase):
    content_object = ParentalKey('core.ContentModule',
                                 on_delete=models.CASCADE,
                                 related_name='tagged_items')
コード例 #16
0
class FormField(AbstractFormField):
    page = ParentalKey('ContactPage', related_name='custom_form_fields')
コード例 #17
0
ファイル: models.py プロジェクト: thedern/edp
class FormField(AbstractFormField):
    page = ParentalKey("ContactPage",
                       on_delete=models.CASCADE,
                       related_name='form_fields')
コード例 #18
0
class FormField(CustomAbstractFormField):

    form = ParentalKey("ContactPage",
                       on_delete=models.CASCADE,
                       related_name="form_fields")