Re:A Django Developer’s Views on Rails
by mdasen on Friday May 29, 2009 @09:07AM
(#631969)
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.
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."
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/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."