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
Andrew Godwin
April 30, 2014
Programming
4
510
Django 1.7 And You
A talk I gave at the San Francisco Django Meetup group
Andrew Godwin
April 30, 2014
Tweet
Share
More Decks by Andrew Godwin
See All by Andrew Godwin
Reconciling Everything
andrewgodwin
1
260
Django Through The Years
andrewgodwin
0
160
Writing Maintainable Software At Scale
andrewgodwin
0
400
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
310
Async, Python, and the Future
andrewgodwin
2
610
How To Break Django: With Async
andrewgodwin
1
670
Taking Django's ORM Async
andrewgodwin
0
680
The Long Road To Asynchrony
andrewgodwin
0
590
The Scientist & The Engineer
andrewgodwin
1
700
Other Decks in Programming
See All in Programming
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
190
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
2
2.5k
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
1k
ドメインイベント増えすぎ問題
h0r15h0
2
560
.NETでOBS Studio操作してみたけど…… / Operating OBS Studio by .NET
skasweb
0
120
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
770
20241217 競争力強化とビジネス価値創出への挑戦:モノタロウのシステムモダナイズ、開発組織の進化と今後の展望
monotaro
PRO
0
280
Beyond ORM
77web
11
1.6k
Findy Team+ Awardを受賞したかった!ベストプラクティス応募内容をふりかえり、開発生産性向上もふりかえる / Findy Team Plus Award BestPractice and DPE Retrospective 2024
honyanya
0
140
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.3k
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
380
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
170
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
98
18k
Fireside Chat
paigeccino
34
3.1k
Embracing the Ebb and Flow
colly
84
4.5k
How to train your dragon (web standard)
notwaldorf
89
5.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Music & Morning Musume
bryan
46
6.3k
Documentation Writing (for coders)
carmenintech
67
4.5k
Side Projects
sachag
452
42k
Typedesign – Prime Four
hannesfritz
40
2.5k
Become a Pro
speakerdeck
PRO
26
5.1k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
500
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