Code

Ticket #7908: 7908.patch

File 7908.patch, 610 bytes (added by mk, 6 years ago)
  • django/db/models/fields/related.py

    diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py
    index ca25df2..1e1c3bd 100644
    a b class RelatedField(object): 
    122122        related = RelatedObject(other, cls, self) 
    123123        if not cls._meta.abstract: 
    124124            self.contribute_to_related_class(other, related) 
     125        else: 
     126            raise TypeError, "Related Model is abstract: %s" % cls.__name__ 
    125127 
    126128    def get_db_prep_lookup(self, lookup_type, value): 
    127129        # If we are doing a lookup on a Related Field, we must be