Sorry the formatting of the code went wrong. Here it is again:

#########################################################

class ContentClassifier(models.Model):

    # <snippet 1>
    def save(self, *args, **kwargs):
        self.compile()
        super(ContentClassifier, self).save(*args, **kwargs)
    # </snippet 1>

    def compile(self):
        ...
        self.posrx = re.compile(regex_string, re.IGNORECASE)

    def classify(self, message):
        # <snippet2>
        # self.compile()
        # </snippet 2>

#########################################################

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to