Package telemeta :: Package models :: Module core :: Class WeakForeignKey
[hide private]
[frames] | no frames]

Class WeakForeignKey

source code

django.db.models.ForeignKey --+    
                              |    
                     ForeignKey --+
                                  |
                                 WeakForeignKey

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

Instance Methods [hide private]
 
__init__(self, to, **kwargs) source code
Method Details [hide private]

__init__(self, to, **kwargs)
(Constructor)

source code 
Overrides: ForeignKey.__init__