[open-ils-commits] r8610 -
trunk/Open-ILS/admin/ils_admin/setup/ils_data
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Feb 4 16:50:40 EST 2008
Author: miker
Date: 2008-02-04 16:22:27 -0500 (Mon, 04 Feb 2008)
New Revision: 8610
Modified:
trunk/Open-ILS/admin/ils_admin/setup/ils_data/models.py
Log:
adding baseline circ matrix models
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-04 18:17:10 UTC (rev 8609)
+++ trunk/Open-ILS/admin/ils_admin/setup/ils_data/models.py 2008-02-04 21:22:27 UTC (rev 8610)
@@ -220,6 +220,36 @@
Config tables
-------------------------------------------------------------- """
+class CircModifier(models.Model):
+ code = models.CharField(maxlength=CHAR_MAXLEN)
+ name = models.CharField(maxlength=CHAR_MAXLEN)
+ description = models.CharField(maxlength=CHAR_MAXLEN);
+ sip2_media_type = models.CharField(maxlength=CHAR_MAXLEN);
+ magnetic_media = models.BooleanField()
+ class Admin:
+ search_fields = ['name','code']
+ list_display = ('code','name','description','sip2_media_type','magnetic_media')
+ class Meta:
+ db_table = 'circ_modifier'
+ ordering = ['name']
+ verbose_name = _('Circulation Modifier')
+ def __str__(self):
+ return self.name
+
+
+class VideoRecordingFormat(models.Model):
+ code = models.CharField(maxlength=CHAR_MAXLEN)
+ value = models.CharField(maxlength=CHAR_MAXLEN, help_text=INTERVAL_HELP_TEXT);
+ class Admin:
+ search_fields = ['value','code']
+ list_display = ('value','code')
+ class Meta:
+ db_table = 'videorecording_format_map'
+ ordering = ['code']
+ verbose_name = _('Video Recording Format')
+ def __str__(self):
+ return self.value
+
class RuleCircDuration(models.Model):
name = models.CharField(maxlength=CHAR_MAXLEN)
extended = models.CharField(maxlength=CHAR_MAXLEN, help_text=INTERVAL_HELP_TEXT);
@@ -236,7 +266,71 @@
def __str__(self):
return self.name
+class CircMatrixMatchpoint(models.Model):
+ active = models.BooleanField()
+ org_unit_id = models.ForeignKey(OrgUnit, db_column='org_unit')
+ grp_id = models.ForeignKey(GrpTree, db_column='grp')
+ circ_modifier_id = models.ForeignKey(CircModifier, db_column='circ_modifier')
+ marc_type_id = models.ForeignKey('ItemTypeMap', db_column='marc_type')
+ marc_form_id = models.ForeignKey('ItemFormMap', db_column='marc_form')
+ marc_vr_format_id = models.ForeignKey('VideoRecordingFormat', db_column='marc_vr_format')
+ ref_flag = models.BooleanField()
+ usr_age_lower_bound = models.CharField(maxlength=CHAR_MAXLEN, help_text=INTERVAL_HELP_TEXT);
+ usr_age_upper_bound = models.CharField(maxlength=CHAR_MAXLEN, help_text=INTERVAL_HELP_TEXT);
+ class Admin:
+ list_display = ('org_unit_id','grp_id','circ_modifier_id','marc_type_id','marc_form_id','marc_vr_format_id','ref_flag','usr_age_lower_bound','usr_age_upper_bound')
+ list_filter = ['grp_id','org_unit_id','circ_modifier_id','marc_type_id','marc_form_id','marc_vr_format_id']
+ class Meta:
+ db_table = 'circ_matrix_matchpoint'
+ ordering = ['name']
+ verbose_name = _('Circulation Matrix Matchpoint')
+ def __str__(self):
+ return _("OrgUnit: %s, Group: %s, Circ Modifier: %s") % (self.org_unit_id, self.grp_id, self.circ_modifier_id)
+class CircMatrixTest(models.Model)
+ matchpoint_id = models.ForeignKey(CircMatrixMatchpoint, db_column='matchpoint')
+ max_items_out = models.IntegerField()
+ max_overdue = models.IntegerField()
+ max_fines = FloatField(max_digits=8, decimal_places=2)
+ script_test = models.CharField(maxlength=CHAR_MAXLEN);
+ class Admin:
+ list_display = ('matchpoint_id','max_items_out','max_overdue','max_fines','script_test')
+ class Meta:
+ db_table = 'circ_matrix_test'
+ ordering = ['matchpoint_id']
+ verbose_name = _('Circ Matrix Test')
+ def __str__(self):
+ return self.matchpoint_id + _(", Max Items Out: %s, Max Overdue: %s, Max Fines: %s") % (self.max_items_out, self.max_overdue, self.max_fines)
+
+class CircMatrixCircModTest(models.Model)
+ matchpoint_id = models.ForeignKey(CircMatrixMatchpoint, db_column='matchpoint')
+ items_out = models.IntegerField()
+ circ_mod_id = models.ForeignKey(CircModifier, db_column='circ_mod')
+ class Admin:
+ search_fields = ['circ_mod_id']
+ list_display = ('matchpoint_id','circ_mod_id','items_out')
+ class Meta:
+ db_table = 'circ_matrix_circ_mod_test'
+ ordering = ['name']
+ verbose_name = _('Circ Matrix Items Out Cirulation Modifier Subtest')
+ def __str__(self):
+ return self.matchpoint_id + _(", Restrict: ") + self.circ_mod_id
+
+class CircMatrixRuleSet(models.Model)
+ matchpoint_id = models.ForeignKey(CircMatrixMatchpoint, db_column='matchpoint')
+ duration_rule_id = models.ForeignKey(RuleCircDuration, db_column='duration_rule')
+ recurring_fine_rule_id = models.ForeignKey(RuleRecurringFine, db_column='recurring_fine_rule')
+ max_fine_rule_id = models.ForeignKey(RuleMaxFine, db_column='max_fine_rule')
+ class Admin:
+ search_fields = ['matchoint_id']
+ list_display = ('matchpoint_id','duration_rule_id','recurring_fine_rule_id','max_fine_rule_id')
+ class Meta:
+ db_table = 'circ_matrix_circ_mod_test'
+ ordering = ['name']
+ verbose_name = _('Circ Matrix Items Out Cirulation Modifier Subtest')
+ def __str__(self):
+ return self.matchpoint_id + _(", Restrict: ") + self.circ_mod_id
+
class RuleMaxFine(models.Model):
name = models.CharField(maxlength=CHAR_MAXLEN)
amount = models.FloatField(max_digits=6, decimal_places=2)
More information about the open-ils-commits
mailing list