Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{"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
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,
)
'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,
)