3 ms·
Skimming through before bed, but: "Even something simple such as following reverse foreign keys isn't implemented in Django" Yes it is, it's very clearly docu
by tvon 17y ago
Skimming through before bed, but:
"Even something simple such as following reverse foreign keys isn't implemented in Django"
Yes it is, it's very clearly documented here:
http://docs.djangoproject.com/en/dev/ref/models/querysets/#id4 http://docs.djangoproject.com/en/dev/ref/models/querysets/#i...
Not much you say about Django is very accurate, actually. Maybe someone else can point out the specifics, but I'm going to bed..
- mdasen 17y agoYou'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."