X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=influences%2Fmodels.py;h=e6e2d2cd86ac16f1ed29d0b6f2532ea2ad337036;hb=12e2c79862407817b1ed71ad31dfdef34f4f5497;hp=049cbeba4f4a7d5f6d82aba0c15439016685c014;hpb=e0314624fa1da2a58161cb43359f72f255aa9b26;p=matthijs%2Fprojects%2Fxerxes.git diff --git a/influences/models.py b/influences/models.py index 049cbeb..e6e2d2c 100644 --- a/influences/models.py +++ b/influences/models.py @@ -1,9 +1,10 @@ from django.db import models from django.core.urlresolvers import reverse from django.contrib.auth.models import User -from django.utils.text import normalize_newlines, wrap +from django.utils.text import normalize_newlines from django.utils.translation import ugettext_lazy as _ from threadedcomments.models import ThreadedComment +from xerxes.tools.text import rewrap # Create your models here. class Character(models.Model): @@ -41,7 +42,7 @@ class Influence(models.Model): contact = models.CharField(max_length=255, verbose_name = _("Contact Name")) summary = models.CharField(max_length=255, verbose_name = _("Summary")) description = models.TextField(verbose_name = _("Description")) - status = models.TextField(max_length=1, choices=STATUS_CHOICES, default='N', verbose_name = _("Status")) + status = models.CharField(max_length=1, choices=STATUS_CHOICES, default='N', verbose_name = _("Status")) longterm = models.BooleanField(default=False, verbose_name = _("Long term")) result = models.TextField(blank=True,verbose_name = _("Result")) @@ -61,7 +62,8 @@ class Influence(models.Model): If private is True, private comments are included in this list. """ def quote_reply(comment): - text = wrap(normalize_newlines(comment.comment), 72) + regex = "^([ >]*)(.*)$" + text = rewrap(normalize_newlines(comment.comment), 72, regex) return "\n".join(["> " + l for l in text.split("\n")]) # Import here to prevent dependency loop, since forms depends on