Start using automake/autoconf for configuring, building, and installing Evergreen
[Evergreen.git] / Open-ILS / admin / ils_admin / setup / ils_data / models.py
index 7d23596..ea19cec 100644 (file)
@@ -270,7 +270,7 @@ class RuleCircDuration(models.Model):
 class CircMatrixMatchpoint(models.Model):
     active = models.BooleanField(blank=False, default=True)
     org_unit_id = models.ForeignKey(OrgUnit, db_column='org_unit', blank=False)
-    grp_id = models.ForeignKey(GrpTree, db_column='grp', blank=False)
+    grp_id = models.ForeignKey(GrpTree, db_column='grp', blank=False, verbose_name=_("User Group"))
     circ_modifier_id = models.ForeignKey(CircModifier, db_column='circ_modifier', null=True,blank=True)
     marc_type_id = models.ForeignKey('ItemTypeMap', db_column='marc_type', null=True,blank=True)
     marc_form_id = models.ForeignKey('ItemFormMap', db_column='marc_form', null=True,blank=True)
@@ -278,6 +278,15 @@ class CircMatrixMatchpoint(models.Model):
     ref_flag = models.BooleanField(null=True)
     usr_age_lower_bound = models.CharField(maxlength=CHAR_MAXLEN, help_text=INTERVAL_HELP_TEXT, null=True, blank=True)
     usr_age_upper_bound = models.CharField(maxlength=CHAR_MAXLEN, help_text=INTERVAL_HELP_TEXT, null=True, blank=True)
+
+    def save(self):
+        ''' Override to force None-ness on the interval fields '''
+        if self.usr_age_lower_bound == "":
+            self.usr_age_lower_bound = None
+        if self.usr_age_upper_bound == "":
+            self.usr_age_upper_bound = None
+        return models.Model.save(self)
+
     class Admin:
         search_fields = ['grp_id','org_unit_id','circ_modifier_id','marc_type_id','marc_form_id',
             'marc_vr_format_id','usr_age_lower_bound','usr_age_upper_bound']