How to use the feincms3.plugins.image function in feincms3

To help you get started, we’ve selected a few feincms3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matthiask / feincms3 / tests / testapp / models.py View on Github external
{"urlconf": "testapp.translated_articles_urls"},
        ),
    ]

    optional = models.IntegerField(blank=True, null=True)
    not_editable = models.IntegerField(blank=True, null=True, editable=False)


PagePlugin = create_plugin_base(Page)


class RichText(richtext.RichText, PagePlugin):
    pass


class Image(image.Image, PagePlugin):
    caption = models.CharField(_("caption"), max_length=200, blank=True)


class Snippet(snippet.Snippet, PagePlugin):
    TEMPLATES = [
        (
            "snippet.html",
            _("snippet"),
            lambda plugin, context: {"plugin": plugin, "additional": "context"},
        )
    ]


class External(external.External, PagePlugin):
    pass
github matthiask / feincms3-example / app / articles / models.py View on Github external
language than returning an URL for the correct app. Better
        show a PR publication on the blog page than switching
        languages.
        """

        return reverse_app(
            (self.category, 'articles'),
            'article-detail',
            kwargs={
                'year': self.publication_date.year,
                'slug': self.slug,
            },
        )


class Image(image.Image):
    article = models.ForeignKey(
        Article,
        on_delete=models.CASCADE,
        verbose_name=_('article'),
        related_name='images',
    )
    caption = models.CharField(
        _('caption'),
        max_length=200,
        blank=True,
    )
github matthiask / feincms3-example / app / pages / models.py View on Github external
'urlconf': 'app.articles.urls',
        }),
        ('blog', _('blog'), {
            'urlconf': 'app.articles.urls',
        }),
    ]


PagePlugin = create_plugin_base(Page)


class RichText(richtext.RichText, PagePlugin):
    pass


class Image(image.Image, PagePlugin):
    caption = models.CharField(
        _('caption'),
        max_length=200,
        blank=True,
    )