TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Django 1.1 release candidate available

70 pointsby zainalmost 16 years ago

3 comments

thomaspainealmost 16 years ago
I recently upgraded to 1.1 because we needed the new aggregation/annotation features. For instance, this is a query we were doing before:<p><pre><code> articles = Article.objects.filter(share__sharedOn__range=date_range).distinct() articles = sorted(articles,key=lambda k: k.TotalRecipients(date_range),reverse=True) </code></pre> which was achingly slow because it involved making a couple thousand SQL queries during the sorting phase. With annotation we can just do:<p><pre><code> articles = Article.objects.filter(share__sharedOn__range=date_range)\ .annotate(total_recipients=Count('shares__recipients')).order_by('total_recipients') </code></pre> which is much much faster and more efficient. Without annotation, we would have had to manually write the SQL or denormalize a bunch of ManyToMany fields, neither of which I was too excited about.
评论 #717560 未加载
评论 #717821 未加载
sidmitraalmost 16 years ago
Release notes :<p><a href="http://docs.djangoproject.com/en/dev/releases/1.1-beta-1/#releases-1-1-beta-1" rel="nofollow">http://docs.djangoproject.com/en/dev/releases/1.1-beta-1/#re...</a><p>Proxy models, deferred models seem like awesome features.
erlangeralmost 16 years ago
"The dumpdata management command now accepts individual model names as arguments, allowing you to export the data just from particular models."<p>That'll be nice for testing.