Skip to content

Commit

Permalink
Bump development version
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Nov 5, 2014
1 parent 03cacb5 commit e60e944
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions djangocms_blog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
from django.core.urlresolvers import reverse
from django.db import models
from django.utils import timezone
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.html import strip_tags, escape
from django.utils.encoding import force_text
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _, get_language
from djangocms_text_ckeditor.fields import HTMLField
Expand All @@ -23,7 +22,6 @@
BLOG_CURRENT_POST_IDENTIFIER = 'djangocms_post_current'


@python_2_unicode_compatible
class BlogCategory(TranslatableModel):
"""
Blog category
Expand All @@ -49,7 +47,7 @@ class Meta:
def count(self):
return self.blog_posts.filter(publish=True).count()

def __str__(self):
def __unicode__(self):
return self.safe_translation_getter('name')

def save(self, *args, **kwargs):
Expand All @@ -61,7 +59,6 @@ def save(self, *args, **kwargs):
self.save_translations()


@python_2_unicode_compatible
class Post(ModelMeta, TranslatableModel):
"""
Blog post
Expand Down Expand Up @@ -158,7 +155,7 @@ def get_description(self):
description = self.safe_translation_getter('meta_description', any_language=True)
if not description:
description = self.safe_translation_getter('abstract', any_language=True)
return escape(strip_tags(description)).strip()
return description.strip()

def get_image_full_url(self):
if self.main_image:
Expand All @@ -178,7 +175,7 @@ class Meta:
ordering = ('-date_published', '-date_created')
get_latest_by = 'date_published'

def __str__(self):
def __unicode__(self):
return self.safe_translation_getter('title')

def save(self, *args, **kwargs):
Expand Down Expand Up @@ -214,7 +211,6 @@ def get_full_url(self):
return self.make_full_url(self.get_absolute_url())


@python_2_unicode_compatible
class LatestPostsPlugin(CMSPlugin):

latest_posts = models.IntegerField(_(u'Articles'), default=get_setting('LATEST_POSTS'),
Expand All @@ -224,7 +220,7 @@ class LatestPostsPlugin(CMSPlugin):
categories = models.ManyToManyField('BlogCategory', blank=True,
help_text=_('Show only the blog articles tagged with chosen categories.'))

def __str__(self):
def __unicode__(self):
return u'%s latest articles by tag' % self.latest_posts

def copy_relations(self, oldinstance):
Expand All @@ -238,7 +234,6 @@ def get_posts(self):
return posts[:self.latest_posts]


@python_2_unicode_compatible
class AuthorEntriesPlugin(CMSPlugin):
authors = models.ManyToManyField(
dj_settings.AUTH_USER_MODEL, verbose_name=_('Authors'),
Expand All @@ -249,7 +244,7 @@ class AuthorEntriesPlugin(CMSPlugin):
help_text=_('The number of author articles to be displayed.')
)

def __str__(self):
def __unicode__(self):
return u'%s latest articles by author' % self.latest_posts

def copy_relations(self, oldinstance):
Expand Down

0 comments on commit e60e944

Please sign in to comment.