3 ms·
You've linked to the documentation about following foreign keys, not reverse foreign keys. So, you have a blog with entries and comments on those entries. A C
by mdasen 17y ago
You've linked to the documentation about following foreign keys, not reverse foreign keys.
So, you have a blog with entries and comments on those entries. A Comment has a ForeignKey to an Entry. That's a normal setup. In Django, you can say Comment.objects.select_related("entry").get(id=5) and that will get you the comment with id 5 and its associated entry. However, you cannot say Entry.objects.select_related("comment_set").get(id=12) to get the blog entry id 12 with its associated comments.
Don't believe me? Well, believe core Django core contributer Malcolm Tredinnick - the lead of the database refactor effort. http://groups.google.com/group/django-users/browse_thread/thread/7b370ac00c4c94ec/ad66a392348ed883?lnk=gst&q=reverse+foreign+key+select_related#ad66a392348ed883 http://groups.google.com/group/django-users/browse_thread/th...
There are a lot of people who use Django that don't realize this limitation exists because they haven't gotten that deep in their usage of the framework.
On a personal note, in the future I would appreciate it if you didn't attack my truthfulness with statements like "Not much you say about Django is very accurate, actually."