Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Django 1.7 And You
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Andrew Godwin
April 30, 2014
Programming
580
4
Share
Django 1.7 And You
A talk I gave at the San Francisco Django Meetup group
Andrew Godwin
April 30, 2014
More Decks by Andrew Godwin
See All by Andrew Godwin
Reconciling Everything
andrewgodwin
1
390
Django Through The Years
andrewgodwin
0
310
Writing Maintainable Software At Scale
andrewgodwin
0
520
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
420
Async, Python, and the Future
andrewgodwin
2
730
How To Break Django: With Async
andrewgodwin
1
810
Taking Django's ORM Async
andrewgodwin
0
830
The Long Road To Asynchrony
andrewgodwin
0
760
The Scientist & The Engineer
andrewgodwin
1
850
Other Decks in Programming
See All in Programming
JavaDoc 再入門
nagise
0
260
Lessons from Spec-Driven Development
simas
PRO
0
130
AIエージェントの隔離技術の徹底比較
kawayu
0
460
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
610
関係性から理解する"同一性"の型用語たち
pvcresin
2
630
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
880
Inside Stream API
skrb
1
620
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
180
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
190
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.8k
Swiftのレキシカルスコープ管理
kntkymt
0
210
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
330
Featured
See All Featured
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
140
A Tale of Four Properties
chriscoyier
163
24k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Building an army of robots
kneath
306
46k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Thoughts on Productivity
jonyablonski
76
5.2k
My Coaching Mixtape
mlcsv
0
140
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
エンジニアに許された特別な時間の終わり
watany
107
250k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Bash Introduction
62gerente
615
210k
Transcript
1.7 Andrew Godwin @andrewgodwin & you
Andrew Godwin Author of South migrations library Hi, I'm Author
of 1.7 Django migrations Generally far too involved in Django
Django 1.7 Migrations Scheduled release: May 15th (we'll probably miss
it) App loading refactor Checks framework select_related filters Custom lookups
Migrations They're pretty good.
The (second) Plan Django Schema backend ORM Hooks South 2
Migration handling User interface Backport for 1.4 - 1.6
Logically Separate Schema backend ORM Hooks Migration handling User interface
SchemaEditor Migrations
A New Format More concise Declarative Introspectable
Migration actions Frozen ORM
None
In-memory running Creates models from migration sets Autodetector diffs created
from on-disk Used to feed SchemaEditor / ORM
Backwards Compatability Auto-applies first migration if tables exist Ignores South-style
migrations South will start looking for south_migrations
App Loading Mostly internal change App objects per-app Start of
long path away from settings
Checks Framework Proper support for project-level validation Old validation moved
in Upgrade warnings now possible
from django.core.checks import register @register() def example_check(app_configs, **kwargs): errors =
[] # ... your check logic here return errors
prefetch_related control Now accepts a Prefetch object Can customise order,
select_related, or filter
Pizza.objects.prefetch_related( Prefetch( 'restaurants', queryset=Restaurant.objects.select_related('best_pizza'), ) )
Custom Lookups Allows for more powerful Field subclasses You can
stop using .extra() and .raw() as much
from django.db.models import Lookup class NotEqual(Lookup): lookup_name = 'ne' def
as_sql(self, qn, connection): lhs, lhs_params = self.process_lhs(qn, connection) rhs, rhs_params = self.process_rhs(qn, connection) params = lhs_params + rhs_params return '%s <> %s' % (lhs, rhs), params
Important Upgrade Notes
Fields need deconstruct() It's a required new method for all
fields.
syncdb is deprecated Use migrate (old apps will still work)
initial_data is dead Use data migrations and the ORM instead
Django 1.8? LTS Migrations for contrib apps PostgreSQL improvements?
Thanks. @andrewgodwin aeracode.org