Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
replacing translated fields with purified/linkified fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jbalogh committed Feb 23, 2010
1 parent 445ba1d commit 7cfa8bc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
9 changes: 5 additions & 4 deletions apps/addons/models.py
Expand Up @@ -10,7 +10,8 @@
import amo.models
from amo.urlresolvers import reverse
from reviews.models import Review
from translations.fields import TranslatedField, translations_with_fallback
from translations.fields import (TranslatedField, PurifiedField,
LinkifiedField, translations_with_fallback)
from users.models import UserProfile
from search import utils as search_utils

Expand Down Expand Up @@ -115,10 +116,10 @@ class Addon(amo.models.ModelBase):
homepage = TranslatedField()
support_email = TranslatedField(db_column='supportemail')
support_url = TranslatedField(db_column='supporturl')
description = TranslatedField()
description = PurifiedField()

summary = TranslatedField()
developer_comments = TranslatedField(db_column='developercomments')
summary = LinkifiedField()
developer_comments = PurifiedField(db_column='developercomments')
eula = TranslatedField()
privacy_policy = TranslatedField(db_column='privacypolicy')
the_reason = TranslatedField()
Expand Down
4 changes: 2 additions & 2 deletions apps/bandwagon/models.py
Expand Up @@ -4,14 +4,14 @@
from addons.models import Addon, AddonCategory
from applications.models import Application
from users.models import UserProfile
from translations.fields import TranslatedField
from translations.fields import TranslatedField, LinkifiedField


class Collection(amo.models.ModelBase):
uuid = models.CharField(max_length=36, blank=True, unique=True)
name = TranslatedField()
nickname = models.CharField(max_length=30, blank=True, unique=True)
description = TranslatedField()
description = LinkifiedField()
defaultlocale = models.CharField(max_length=10, default='en-US')
collection_type = models.PositiveIntegerField(default=0)
icontype = models.CharField(max_length=25, blank=True)
Expand Down
8 changes: 4 additions & 4 deletions apps/users/models.py
Expand Up @@ -3,7 +3,6 @@
import random
import re
import string
import urlparse

from django.conf import settings
from django.core.urlresolvers import reverse
Expand All @@ -12,7 +11,7 @@

import amo
import amo.models
from translations.fields import TranslatedField
from translations.fields import PurifiedField


def get_hexdigest(algorithm, salt, raw_password):
Expand All @@ -38,7 +37,7 @@ class UserProfile(amo.models.ModelBase):
email = models.EmailField(unique=True)

averagerating = models.CharField(max_length=255, blank=True)
bio = TranslatedField()
bio = PurifiedField()
confirmationcode = models.CharField(max_length=255, default='',
blank=True)
deleted = models.BooleanField(default=True)
Expand Down Expand Up @@ -83,7 +82,8 @@ def picture_url(self):

@amo.cached_property
def is_developer(self):
return bool(self.addons.filter(authors=self, addonuser__listed=True)[:1])
return bool(self.addons.filter(authors=self,
addonuser__listed=True)[:1])

@property
def display_name(self):
Expand Down
4 changes: 2 additions & 2 deletions apps/versions/models.py
Expand Up @@ -5,14 +5,14 @@
import amo.models
from addons.models import Addon
from applications.models import Application, AppVersion
from translations.fields import TranslatedField
from translations.fields import TranslatedField, PurifiedField
from users.models import UserProfile


class Version(amo.models.ModelBase):
addon = models.ForeignKey(Addon, related_name='versions')
license = models.ForeignKey('License', null=True)
releasenotes = TranslatedField()
releasenotes = PurifiedField()
approvalnotes = models.TextField(default="")
version = models.CharField(max_length=255, default=0)

Expand Down

0 comments on commit 7cfa8bc

Please sign in to comment.