+ #classmethod
+ def getValidators(cls):
+ """ primarily for REST API, return a dictionary of field names mapped
+ to lists of the type of validations that need to be applied to
+ those fields.
+ """
+ validators = {}
+ for field in cls._meta.fields:
+ l = []
+ if field.blank==False:
+ l.append("notBlank")
+ if field.__class__.__name__=="URLField":
+ l.append("url")
+ validators[field.name] = l
+ return validators
+
+ # ---- end copy stuff from DiffModelMixin ----
+
+ # default values for created and updated are only there to keep evolution
+ # from failing.
+ created = models.DateTimeField(auto_now_add=True, default=timezone.now)
+ updated = models.DateTimeField(auto_now=True, default=timezone.now)
+ enacted = models.DateTimeField(null=True, blank=True, default=None)
+ policed = models.DateTimeField(null=True, blank=True, default=None)
+ backend_status = models.CharField(max_length=140,
+ default="0 - Provisioning in progress")
+ deleted = models.BooleanField(default=False)
+
+ class Meta:
+ # Changing abstract to False would require the managers of subclasses of
+ # PlCoreBase to be customized individually.
+ abstract = True
+ app_label = "core"
+
+ def __init__(self, *args, **kwargs):
+ super(PlCoreBase, self).__init__(*args, **kwargs)
+ self._initial = self._dict # for DiffModelMixIn
+ self.silent = False
+