~bnrubin/bantrackertwo/devel

« back to all changes in this revision

Viewing changes to bt/models.py

  • Committer: Benjamin Rubin
  • Date: 2010-04-22 12:52:10 UTC
  • Revision ID: bnrubin@romulus-20100422125210-68ez41ig3okw2rpt
- Since we're now using ircd7, it makes sense to sepatate mutes (+q) into a separate class

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
    def is_removed(self):
59
59
        return self.removal_date != None
60
60
 
61
 
    def is_mute(self):
62
 
        return self.mask[0] == '%'
63
 
 
64
61
    def __unicode__(self):
65
62
        return self.mask
66
63
 
67
64
    def ban_pattern(self):
68
65
        return re.compile(self.mask.replace('?','.').replace('*','.*'))
69
66
   
 
67
class Mute(Event):
 
68
    mask = models.CharField(max_length=255)
 
69
    removal_date = models.DateTimeField(null = True)
 
70
    removed_by = models.ForeignKey('Operator', null = True, related_name = 'removed_by')
 
71
 
 
72
    def is_removed(self):
 
73
        return self.removal_date != None
 
74
                
 
75
    def __unicode__(self):
 
76
        return self.mask
 
77
                            
 
78
    def ban_pattern(self):
 
79
       return re.compile(self.mask.replace('?','.').replace('*','.*')
 
80
 
70
81
class Kick(Event):
71
82
    reason = models.CharField(max_length=255,null = True) 
72
83