Code

Ticket #3323: django.db.models.options.rev6263.diff

File django.db.models.options.rev6263.diff, 670 bytes (added by Axis_of_Entropy, 7 years ago)

similar hackish fix for ManyToManyField

Line 
1Index: django/db/models/options.py
2===================================================================
3--- django/db/models/options.py (revision 6263)
4+++ django/db/models/options.py (working copy)
5@@ -186,6 +186,8 @@
6             rel_objs = []
7             for klass in get_models():
8                 for f in klass._meta.many_to_many:
9+                    if f.rel and isinstance(f.rel.to, str):
10+                        raise Exception("class %s has unresolved string relation" % klass)
11                     if f.rel and self == f.rel.to._meta:
12                         rel_objs.append(RelatedObject(f.rel.to, klass, f))
13             if app_cache_ready():