comparison gpp/antispam/models.py @ 214:28988cce138b

Implement #83: a string filter facility like NukeSeSentinel. It currently isn't hooked up to anything. Will do that in #84.
author Brian Neal <bgneal@gmail.com>
date Fri, 14 May 2010 02:19:48 +0000
parents
children 8c1832b9d815
comparison
equal deleted inserted replaced
213:65016249bf35 214:28988cce138b
1 """Models for the antispam application."""
2 from django.db import models
3 from django.core.cache import cache
4
5 from antispam import SPAM_PHRASE_KEY
6
7
8 class SpamPhrase(models.Model):
9 """A SpamPhrase is a string that is checked for in user input. User input
10 containing a SpamPhrase should be blocked and flagged.
11 """
12 phrase = models.CharField(max_length=64)
13
14 class Meta:
15 ordering = ('phrase', )
16
17 def __unicode__(self):
18 return self.phrase
19
20 def save(self, *args, **kwargs):
21 cache.delete(SPAM_PHRASE_KEY)
22 super(SpamPhrase, self).save(*args, **kwargs)