]> git.parisson.com Git - telemeta.git/commitdiff
Remove WeakForeignKey - remove unused class
authorThomas Fillon <thomas@parisson.com>
Tue, 18 Jul 2017 13:07:43 +0000 (15:07 +0200)
committerThomas Fillon <thomas@parisson.com>
Tue, 18 Jul 2017 13:07:43 +0000 (15:07 +0200)
telemeta/models/fields.py

index 8629d0432b0864a6f0a5820cdca40fa385fd6c34..ef1cfc0142530724cfd80269e0c5c13b1b0d6bff 100644 (file)
@@ -198,26 +198,6 @@ class ForeignKey(models.ForeignKey):
         super(ForeignKey, self).__init__(to, **normalize_field(kwargs, 0))
 
 
-class WeakForeignKey(ForeignKey):
-    """A weak foreign key is the same as foreign key but without cascading
-    delete. Instead the reference is set to null when the referenced record
-    get deleted. This emulates the ON DELETE SET NULL sql behaviour.
-
-    This field is automatically allowed to be null, there's no need to pass
-    null=True.
-
-    The constructor arguments are normalized with normalize_field() by the
-    parent ForeignKey
-
-    Warning: must be used in conjunction with EnhancedQuerySet, EnhancedManager,
-    and EnhancedModel
-    """
-    def __init__(self, to, **kwargs):
-        kwargs['null'] = True
-        super(WeakForeignKey, self).__init__(to, **kwargs)
-
-
-
 class CharField(models.CharField):
     """This is a CharField with a default max_length of 250.