Commits

Udi Bauman committed 90f0ec6

Changed constraint to consist of the actual function code

Comments (0)

Files changed (2)

django_ultrasound/events/admin.py

 admin.site.register(EventType,EventTypeAdmin)  
 
 class ConstraintAdmin(admin.ModelAdmin):
-    list_display = ["constraintDiscriptions", "constrainMethode" ]
+    list_display = ["description", "constraint_code" ]
 admin.site.register(Constraint,ConstraintAdmin)
 
 class AllocationAdmin(admin.TabularInline):

django_ultrasound/events/models.py

     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)