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
560
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
360
Django Through The Years
andrewgodwin
0
270
Writing Maintainable Software At Scale
andrewgodwin
0
490
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
390
Async, Python, and the Future
andrewgodwin
2
710
How To Break Django: With Async
andrewgodwin
1
770
Taking Django's ORM Async
andrewgodwin
0
760
The Long Road To Asynchrony
andrewgodwin
0
720
The Scientist & The Engineer
andrewgodwin
1
810
Other Decks in Programming
See All in Programming
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.6k
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
190
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
3.4k
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
330
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
500
AI Agent Dojo #4: watsonx Orchestrate ADK体験
oniak3ibm
PRO
0
130
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
0
890
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
510
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
380
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
2.3k
Oxlintはいいぞ
yug1224
4
590
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
570
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
Embracing the Ebb and Flow
colly
88
5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.9k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
Site-Speed That Sticks
csswizardry
13
1k
Ruling the World: When Life Gets Gamed
codingconduct
0
130
Typedesign – Prime Four
hannesfritz
42
2.9k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
120
How to make the Groovebox
asonas
2
1.9k
Test your architecture with Archunit
thirion
1
2.1k
Building the Perfect Custom Keyboard
takai
2
670
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