Ticket #3323: django-string-rel.patch

File django-string-rel.patch, 668 bytes (added by alex@…, 18 years ago)

quick hack

  • django/db/models/options.py

     
    121121            rel_objs = []
    122122            for klass in get_models():
    123123                for f in klass._meta.fields:
     124                    if f.rel and isinstance(f.rel.to, str):
     125                        raise Exception("class %s has unresolved string relation" % klass)
    124126                    if f.rel and self == f.rel.to._meta:
    125127                        rel_objs.append(RelatedObject(f.rel.to, klass, f))
    126128            self._all_related_objects = rel_objs
Back to Top