~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to threadedcomments/models.py

  • Committer: kaputtnik
  • Date: 2019-06-14 18:40:56 UTC
  • mfrom: (532.1.31 widelands)
  • Revision ID: kaputtnik-20190614184056-l0ha8pm5zais9mxk
Adapted code for use with python 3.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
from django.db.models import Q
7
7
from django.utils.translation import ugettext_lazy as _
8
8
from django.conf import settings
9
 
from django.utils.encoding import force_unicode
 
9
from django.utils.encoding import force_text
10
10
 
11
11
DEFAULT_MAX_COMMENT_LENGTH = getattr(
12
12
    settings, 'DEFAULT_MAX_COMMENT_LENGTH', 1000)
178
178
    objects = ThreadedCommentManager()
179
179
    public = PublicThreadedCommentManager()
180
180
 
181
 
    def __unicode__(self):
 
181
    def __str__(self):
182
182
        if len(self.comment) > 50:
183
183
            return self.comment[:50] + '...'
184
184
        return self.comment[:50]