Udi Bauman  committed 90f0ec6

Changed constraint to consist of the actual function code

  • Participants
  • Parent commits 6c99c66
  • Branches default

Comments (0)

Files changed (2)

File django_ultrasound/events/,EventTypeAdmin)  
 class ConstraintAdmin(admin.ModelAdmin):
-    list_display = ["constraintDiscriptions", "constrainMethode" ]
+    list_display = ["description", "constraint_code" ],ConstraintAdmin)
 class AllocationAdmin(admin.TabularInline):

File django_ultrasound/events/

     discriptionsType = models.CharField(_('the type of the event '),max_length=100)
 class Constraint(models.Model):
-    constraintDiscriptions = models.CharField(_('the decription of the constrain'),max_length=100)
-    constrainMethode = models.CharField(_('the name of the function'),max_length=100)
+    description = models.CharField(_('description'),max_length=100, help_text=_("The description of the constraint"))
+    constraint_code = models.TextField(_('constraint code'),max_length=1000,
+                                        help_text=_("The code should be a Python expression, evaluating to a boolean value. Assume one parameter named: 'customer', which is the Customer entity to check."))
 class Event(models.Model):
     description = models.CharField(_('the descrition of the event'), max_length=500)