[open-ils-commits] r8655 -
trunk/Open-ILS/admin/ils_admin/setup/ils_data
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Feb 5 23:46:24 EST 2008
Author: erickson
Date: 2008-02-05 23:18:00 -0500 (Tue, 05 Feb 2008)
New Revision: 8655
Modified:
trunk/Open-ILS/admin/ils_admin/setup/ils_data/models.py
Log:
overriding save to force None-ness on the interval fields
Modified: trunk/Open-ILS/admin/ils_admin/setup/ils_data/models.py
===================================================================
--- trunk/Open-ILS/admin/ils_admin/setup/ils_data/models.py 2008-02-06 04:00:23 UTC (rev 8654)
+++ trunk/Open-ILS/admin/ils_admin/setup/ils_data/models.py 2008-02-06 04:18:00 UTC (rev 8655)
@@ -278,6 +278,15 @@
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']
More information about the open-ils-commits
mailing list