# Path: djangocms_blog/settings.py
# def get_setting(name):
#     """Get setting value from django settings with fallback to globals defaults."""
#     from django.conf import settings
# 
#     return getattr(settings, "BLOG_%s" % name, params["BLOG_%s" % name])
# 
# Path: djangocms_blog/liveblog/models.py
# class Liveblog(LiveblogInterface, AbstractText):
#     """
#     Basic liveblog plugin model
#     """
# 
#     cmsplugin_ptr = models.OneToOneField(
#         CMSPlugin, related_name="%(app_label)s_%(class)s", primary_key=True, parent_link=True, on_delete=models.CASCADE
#     )
#     title = models.CharField(_("title"), max_length=255)
#     image = FilerImageField(
#         verbose_name=_("image"),
#         blank=True,
#         null=True,
#         on_delete=models.SET_NULL,
#         related_name="djangocms_blog_liveblog_image",
#     )
#     thumbnail = models.ForeignKey(
#         thumbnail_model,
#         verbose_name=_("thumbnail size"),
#         on_delete=models.SET_NULL,
#         blank=True,
#         null=True,
#         related_name="djangocms_blog_liveblog_thumbnail",
#     )
# 
#     class Meta:
#         verbose_name = _("liveblog entry")
#         verbose_name_plural = _("liveblog entries")
# 
#     def save(self, *args, **kwargs):
#         super().save(*args, **kwargs)
#         self._post_save()
# 
#     def __str__(self):
#         return AbstractText.__str__(self)


from cms.plugin_pool import plugin_pool
from django.utils.translation import gettext_lazy as _
from djangocms_text_ckeditor.cms_plugins import TextPlugin
from djangocms_blog.settings import get_setting
from .models import Liveblog




class LiveblogPlugin(TextPlugin):
    module = get_setting("PLUGIN_MODULE_NAME")
    name = _("Liveblog item")
    model = Liveblog
    fields = ("title", "publish", "body", "post_date")

# Path: djangocms_blog/settings.py
# def get_setting(name):
#     """Get setting value from django settings with fallback to globals defaults."""
#     from django.conf import settings
# 
#     return getattr(settings, "BLOG_%s" % name, params["BLOG_%s" % name])
# 
# Path: djangocms_blog/liveblog/models.py
# class Liveblog(LiveblogInterface, AbstractText):
#     """
#     Basic liveblog plugin model
#     """
# 
#     cmsplugin_ptr = models.OneToOneField(
#         CMSPlugin, related_name="%(app_label)s_%(class)s", primary_key=True, parent_link=True, on_delete=models.CASCADE
#     )
#     title = models.CharField(_("title"), max_length=255)
#     image = FilerImageField(
#         verbose_name=_("image"),
#         blank=True,
#         null=True,
#         on_delete=models.SET_NULL,
#         related_name="djangocms_blog_liveblog_image",
#     )
#     thumbnail = models.ForeignKey(
#         thumbnail_model,
#         verbose_name=_("thumbnail size"),
#         on_delete=models.SET_NULL,
#         blank=True,
#         null=True,
#         related_name="djangocms_blog_liveblog_thumbnail",
#     )
# 
#     class Meta:
#         verbose_name = _("liveblog entry")
#         verbose_name_plural = _("liveblog entries")
# 
#     def save(self, *args, **kwargs):
#         super().save(*args, **kwargs)
#         self._post_save()
# 
#     def __str__(self):
#         return AbstractText.__str__(self)


# Path: djangocms_blog/liveblog/cms_plugins.py
from cms.plugin_pool import plugin_pool
from django.utils.translation import gettext_lazy as _
from djangocms_text_ckeditor.cms_plugins import TextPlugin
from djangocms_blog.settings import get_setting
from .models import Liveblog





class LiveblogPlugin(TextPlugin):
    module = get_setting("PLUGIN_MODULE_NAME")
    name = _("Liveblog item")
    model = Liveblog
    fields = ("title", "publish", "body", "post_date")

    render_template = "liveblog/plugins/liveblog.html"