Jannis Leidel committed 054c2f5

Minor cleanups.

  • Participants
  • Parent commits 4e9eb14

Comments (0)

Files changed (2)


 from django.db import models
 from django.conf import settings
-class AutoCreatedField (models.DateTimeField):
+class AutoCreatedField(models.DateTimeField):
     A DateTimeField that automatically populates itself at
     object creation.
     By default, sets editable=False,
-    def __init__ (self, *args, **kwargs):
+    def __init__(self, *args, **kwargs):
         kwargs.setdefault('editable', False)
         super(AutoCreatedField, self).__init__(*args, **kwargs)
-class AutoLastModifiedField (AutoCreatedField):
+class AutoLastModifiedField(AutoCreatedField):
     A DateTimeField that updates itself on each save() of the model.
     By default, sets editable=False and
-    def pre_save (self, model_instance, add):
+    def pre_save(self, model_instance, add):
         value =
         setattr(model_instance, self.attname, value)
-        return value    
+        return value
 SPLIT_MARKER = getattr(settings, 'SPLIT_MARKER', '<!-- split -->')


     real_type = models.ForeignKey(ContentType, editable=False, null=True)
     def save(self, *args, **kwargs):
         if not
             self.real_type = self._get_real_type()
         super(InheritanceCastModel, self).save(*args, **kwargs)
     def _get_real_type(self):
         return ContentType.objects.get_for_model(type(self))
     def cast(self):
         return self.real_type.get_object_for_this_type(
     class Meta:
         abstract = True
-class TimeStampedModel (models.Model):
+class TimeStampedModel(models.Model):
     An abstract base class model that provides self-updating
     ``created`` and ``modified`` fields.