[open-ils-commits] r8627 -
trunk/Open-ILS/admin/ils_admin/setup/ils_data
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Feb 5 08:49:31 EST 2008
Author: miker
Date: 2008-02-05 08:21:10 -0500 (Tue, 05 Feb 2008)
New Revision: 8627
Modified:
trunk/Open-ILS/admin/ils_admin/setup/ils_data/models.py
Log:
updating models with (what should be) working display code
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-05 04:30:59 UTC (rev 8626)
+++ trunk/Open-ILS/admin/ils_admin/setup/ils_data/models.py 2008-02-05 13:21:10 UTC (rev 8627)
@@ -221,7 +221,7 @@
-------------------------------------------------------------- """
class CircModifier(models.Model):
- code = models.CharField(maxlength=CHAR_MAXLEN)
+ code = models.CharField(maxlength=CHAR_MAXLEN, blank=False, primary_key=True)
name = models.CharField(maxlength=CHAR_MAXLEN)
description = models.CharField(maxlength=CHAR_MAXLEN);
sip2_media_type = models.CharField(maxlength=CHAR_MAXLEN);
@@ -238,7 +238,7 @@
class VideoRecordingFormat(models.Model):
- code = models.CharField(maxlength=CHAR_MAXLEN)
+ code = models.CharField(maxlength=CHAR_MAXLEN, blank=False, primary_key=True)
value = models.CharField(maxlength=CHAR_MAXLEN, help_text=INTERVAL_HELP_TEXT);
class Admin:
search_fields = ['value','code']
@@ -267,32 +267,50 @@
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);
+ 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)
+ circ_modifier_id = models.ForeignKey(CircModifier, db_column='circ_modifier', null=True)
+ marc_type_id = models.ForeignKey('ItemTypeMap', db_column='marc_type', null=True)
+ marc_form_id = models.ForeignKey('ItemFormMap', db_column='marc_form', null=True)
+ marc_vr_format_id = models.ForeignKey('VideoRecordingFormat', db_column='marc_vr_format', null=True)
+ ref_flag = models.BooleanField(null=True)
+ usr_age_lower_bound = models.CharField(maxlength=CHAR_MAXLEN, help_text=INTERVAL_HELP_TEXT, null=True)
+ usr_age_upper_bound = models.CharField(maxlength=CHAR_MAXLEN, help_text=INTERVAL_HELP_TEXT, null=True)
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')
+ fields = (
+ (None, {
+ 'fields': ('org_unit_id', 'circ_modifier_id', 'marc_type_id', 'marc_form_id','marc_vr_format_id','usr_age_lower_bound','usr_age_upper_bound')
+ }),
+ ('Baseline Test', {
+ 'classes': 'collapse',
+ 'fields' : ('circmatrixtest_set')
+ }),
+ ('Circ Mod Tests', {
+ 'classes': 'collapse',
+ 'fields': ('circmatrixcircmodtest_set')
+ }),
+ ('Ruleset', {
+ 'classes': 'collapse',
+ 'fields': ('circmatrixruleset_set')
+ })
+ )
+ 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']
+ list_display = ('grp_id','org_unit_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 = ['org_unit_id', 'grp_id']
+ ordering = ['id']
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 = models.FloatField(max_digits=8, decimal_places=2)
- script_test = models.CharField(maxlength=CHAR_MAXLEN);
+ matchpoint_id = models.ForeignKey(CircMatrixMatchpoint, db_column='matchpoint', blank=False, primary_key=True)
+ max_items_out = models.IntegerField(null=True)
+ max_overdue = models.IntegerField(null=True)
+ max_fines = models.FloatField(max_digits=8, decimal_places=2, null=True)
+ script_test = models.CharField(maxlength=CHAR_MAXLEN, null=True)
class Admin:
list_display = ('matchpoint_id','max_items_out','max_overdue','max_fines','script_test')
class Meta:
@@ -303,9 +321,9 @@
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')
+ matchpoint_id = models.ForeignKey(CircMatrixMatchpoint, db_column='matchpoint', blank=False)
+ items_out = models.IntegerField(blank=False)
+ circ_mod_id = models.ForeignKey(CircModifier, db_column='circ_mod', blank=False)
class Admin:
search_fields = ['circ_mod_id']
list_display = ('matchpoint_id','circ_mod_id','items_out')
@@ -314,22 +332,22 @@
ordering = ['matchpoint_id']
verbose_name = _('Circ Matrix Items Out Cirulation Modifier Subtest')
def __str__(self):
- return self.matchpoint_id + _(", Restrict: ") + self.circ_mod_id
+ return self.matchpoint_id + _(", Restriction: ") + 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')
+ matchpoint_id = models.ForeignKey(CircMatrixMatchpoint, db_column='matchpoint', blank=False, primary_key=True)
+ duration_rule_id = models.ForeignKey(RuleCircDuration, db_column='duration_rule', blank=False)
+ recurring_fine_rule_id = models.ForeignKey('RuleRecurringFine', db_column='recurring_fine_rule', blank=False)
+ max_fine_rule_id = models.ForeignKey('RuleMaxFine', db_column='max_fine_rule', blank=False)
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'
+ db_table = 'circ_matrix_ruleset'
ordering = ['matchpoint_id']
- verbose_name = _('Circ Matrix Items Out Cirulation Modifier Subtest')
+ verbose_name = _('Circ Matrix Rule Set')
def __str__(self):
- return self.matchpoint_id + _(", Restrict: ") + self.circ_mod_id
+ return _(", Duration: %s, Recurring Fine: %s, Max Fine: %s") % (self.duration_rule_id, self.recurring_fine_rule_id, self.max_fine_rule_id)
class RuleMaxFine(models.Model):
name = models.CharField(maxlength=CHAR_MAXLEN)
More information about the open-ils-commits
mailing list