# Path: djangocms_blog/models.py
# BLOG_CURRENT_POST_IDENTIFIER = get_setting("CURRENT_POST_IDENTIFIER")
# BLOG_CURRENT_NAMESPACE = get_setting("CURRENT_NAMESPACE")
# BLOG_PLUGIN_TEMPLATE_FOLDERS = get_setting("PLUGIN_TEMPLATE_FOLDERS")
#     class KnockerModel:
# class BlogMetaMixin(ModelMeta):
# class BlogCategory(BlogMetaMixin, TranslatableModel):
#     class Meta:
# class Post(KnockerModel, BlogMetaMixin, TranslatableModel):
#     class Meta:
# class BasePostPlugin(CMSPlugin):
#     class Meta:
# class LatestPostsPlugin(BasePostPlugin):
# class AuthorEntriesPlugin(BasePostPlugin):
# class GenericBlogPlugin(BasePostPlugin):
#     class Meta:
# def _get_language(instance, language):
#     def get_meta_attribute(self, param):
#     def get_locale(self):
#     def get_full_url(self):
#     def descendants(self):
#     def linked_posts(self):
#     def count(self):
#     def count_all_sites(self):
#     def get_absolute_url(self, lang=None):
#     def __str__(self):
#     def save(self, *args, **kwargs):
#     def get_title(self):
#     def get_description(self):
#     def __str__(self):
#     def guid(self, language=None):
#     def date(self):
#     def save(self, *args, **kwargs):
#     def save_translation(self, translation, *args, **kwargs):
#     def get_absolute_url(self, lang=None):
#     def get_title(self):
#     def get_keywords(self):
#     def get_description(self):
#     def get_image_full_url(self):
#     def get_image_width(self):
#     def get_image_height(self):
#     def get_tags(self):
#     def get_author(self):
#     def _set_default_author(self, current_user):
#     def thumbnail_options(self):
#     def full_image_options(self):
#     def is_published(self):
#     def should_knock(self, signal_type, created=False):
#     def get_cache_key(self, language, prefix):
#     def liveblog_group(self):
#     def optimize(self, qs):
#     def post_queryset(self, request=None, published_only=True):
#     def __str__(self):
#     def copy_relations(self, oldinstance):
#     def get_posts(self, request, published_only=True):
#     def __str__(self):
#     def copy_relations(self, oldinstance):
#     def get_posts(self, request, published_only=True):
#     def get_authors(self, request):
#     def __str__(self):
# def pre_delete_post(sender, instance, **kwargs):
# def post_save_post(sender, instance, **kwargs):
# 
# Path: djangocms_blog/settings.py
# DATE_FORMAT = "%a %d %b %Y %H:%M"


from operator import itemgetter
from asgiref.sync import async_to_sync
from channels.layers import get_channel_layer
from cms.models import CMSPlugin
from cms.utils.plugins import reorder_plugins
from django.db import models
from django.template import Context
from django.utils.timezone import now
from django.utils.translation import gettext_lazy as _
from djangocms_text_ckeditor.models import AbstractText
from filer.fields.image import FilerImageField
from djangocms_blog.models import Post, thumbnail_model
from djangocms_blog.settings import DATE_FORMAT
        from cms.plugin_rendering import ContentRenderer
            items.extend(model.objects.filter(placeholder=self.placeholder).values("pk", "post_date"))
        order = reversed([item["pk"] for item in sorted(items, key=itemgetter("post_date"))])
        reorder_plugins(self.placeholder, None, self.language, order)

    @property
    def liveblog_group(self):
        post = Post.objects.language(self.language).filter(liveblog=self.placeholder).first()
        if post:
            return post.liveblog_group

    def render(self, request):
        context = Context({"request": request})

        renderer = ContentRenderer(request)
        return renderer.render_plugin(
            instance=self,
            context=context,
            placeholder=self.placeholder,
        )

    def send(self, request):
        """
        Render the content and send to the related group
        """
        if self.liveblog_group:
            content = self.render(request)
            notification = {
                "id": self.pk,
                "content": content,
                "creation_date": self.post_date.strftime(DATE_FORMAT),

# Path: djangocms_blog/models.py
# BLOG_CURRENT_POST_IDENTIFIER = get_setting("CURRENT_POST_IDENTIFIER")
# BLOG_CURRENT_NAMESPACE = get_setting("CURRENT_NAMESPACE")
# BLOG_PLUGIN_TEMPLATE_FOLDERS = get_setting("PLUGIN_TEMPLATE_FOLDERS")
#     class KnockerModel:
# class BlogMetaMixin(ModelMeta):
# class BlogCategory(BlogMetaMixin, TranslatableModel):
#     class Meta:
# class Post(KnockerModel, BlogMetaMixin, TranslatableModel):
#     class Meta:
# class BasePostPlugin(CMSPlugin):
#     class Meta:
# class LatestPostsPlugin(BasePostPlugin):
# class AuthorEntriesPlugin(BasePostPlugin):
# class GenericBlogPlugin(BasePostPlugin):
#     class Meta:
# def _get_language(instance, language):
#     def get_meta_attribute(self, param):
#     def get_locale(self):
#     def get_full_url(self):
#     def descendants(self):
#     def linked_posts(self):
#     def count(self):
#     def count_all_sites(self):
#     def get_absolute_url(self, lang=None):
#     def __str__(self):
#     def save(self, *args, **kwargs):
#     def get_title(self):
#     def get_description(self):
#     def __str__(self):
#     def guid(self, language=None):
#     def date(self):
#     def save(self, *args, **kwargs):
#     def save_translation(self, translation, *args, **kwargs):
#     def get_absolute_url(self, lang=None):
#     def get_title(self):
#     def get_keywords(self):
#     def get_description(self):
#     def get_image_full_url(self):
#     def get_image_width(self):
#     def get_image_height(self):
#     def get_tags(self):
#     def get_author(self):
#     def _set_default_author(self, current_user):
#     def thumbnail_options(self):
#     def full_image_options(self):
#     def is_published(self):
#     def should_knock(self, signal_type, created=False):
#     def get_cache_key(self, language, prefix):
#     def liveblog_group(self):
#     def optimize(self, qs):
#     def post_queryset(self, request=None, published_only=True):
#     def __str__(self):
#     def copy_relations(self, oldinstance):
#     def get_posts(self, request, published_only=True):
#     def __str__(self):
#     def copy_relations(self, oldinstance):
#     def get_posts(self, request, published_only=True):
#     def get_authors(self, request):
#     def __str__(self):
# def pre_delete_post(sender, instance, **kwargs):
# def post_save_post(sender, instance, **kwargs):
# 
# Path: djangocms_blog/settings.py
# DATE_FORMAT = "%a %d %b %Y %H:%M"


# Path: djangocms_blog/liveblog/models.py
from operator import itemgetter
from asgiref.sync import async_to_sync
from channels.layers import get_channel_layer
from cms.models import CMSPlugin
from cms.utils.plugins import reorder_plugins
from django.db import models
from django.template import Context
from django.utils.timezone import now
from django.utils.translation import gettext_lazy as _
from djangocms_text_ckeditor.models import AbstractText
from filer.fields.image import FilerImageField
from djangocms_blog.models import Post, thumbnail_model
from djangocms_blog.settings import DATE_FORMAT
        from cms.plugin_rendering import ContentRenderer

            items.extend(model.objects.filter(placeholder=self.placeholder).values("pk", "post_date"))
        order = reversed([item["pk"] for item in sorted(items, key=itemgetter("post_date"))])
        reorder_plugins(self.placeholder, None, self.language, order)

    @property
    def liveblog_group(self):
        post = Post.objects.language(self.language).filter(liveblog=self.placeholder).first()
        if post:
            return post.liveblog_group

    def render(self, request):
        context = Context({"request": request})

        renderer = ContentRenderer(request)
        return renderer.render_plugin(
            instance=self,
            context=context,
            placeholder=self.placeholder,
        )

    def send(self, request):
        """
        Render the content and send to the related group
        """
        if self.liveblog_group:
            content = self.render(request)
            notification = {
                "id": self.pk,
                "content": content,
                "creation_date": self.post_date.strftime(DATE_FORMAT),

                "changed_date": self.changed_date.strftime(DATE_FORMAT),