diff options
author | Filipp Lepalaan <filipp@mac.com> | 2016-02-25 23:22:44 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2016-02-25 23:22:44 +0200 |
commit | 3354db92caf9ce2f51e9045956ab10aeecaed0b5 (patch) | |
tree | f518a5bb9b82e21525f6414dc3eca173ba9a9083 /servo | |
parent | d7b1aff640ae7c5a9364fc1f76c7245d260ee522 (diff) | |
download | Servo-3354db92caf9ce2f51e9045956ab10aeecaed0b5.tar.gz Servo-3354db92caf9ce2f51e9045956ab10aeecaed0b5.tar.bz2 Servo-3354db92caf9ce2f51e9045956ab10aeecaed0b5.zip |
Added ActiveManager
Diffstat (limited to 'servo')
-rw-r--r-- | servo/models/repair.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/servo/models/repair.py b/servo/models/repair.py index db983dc..6a9e67a 100644 --- a/servo/models/repair.py +++ b/servo/models/repair.py @@ -84,6 +84,14 @@ class ChecklistItemValue(models.Model): app_label = "servo" +class ActiveManager(models.Manager): + """ + GSX repairs that have been submitted, and not marked complete + """ + def active(self, **kwargs): + return self.filter(completed_at=None, **kwargs).exclude(submitted_at=None) + + class Repair(models.Model): """ Proxies service order data between our internal @@ -188,10 +196,11 @@ class Repair(models.Model): symptom_code = models.CharField(max_length=7, default='') issue_code = models.CharField(max_length=7, default='') + active = ActiveManager() def is_submitted(self): return self.submitted_at is not None - + def get_symptom_code_choices(self): """ Returns the possible symptom codes for the current serial number |