Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
350
Django Through The Years
andrewgodwin
0
270
Writing Maintainable Software At Scale
andrewgodwin
0
480
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
380
Async, Python, and the Future
andrewgodwin
2
700
How To Break Django: With Async
andrewgodwin
1
760
Taking Django's ORM Async
andrewgodwin
0
760
The Long Road To Asynchrony
andrewgodwin
0
720
The Scientist & The Engineer
andrewgodwin
1
800
Other Decks in Programming
See All in Programming
AIコーディングエージェント(Gemini)
kondai24
0
270
Combinatorial Interview Problems with Backtracking Solutions - From Imperative Procedural Programming to Declarative Functional Programming - Part 2
philipschwarz
PRO
0
110
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
140
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
190
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
170
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
7
2.3k
Pythonではじめるオープンデータ分析〜書籍の紹介と書籍で紹介しきれなかった事例の紹介〜
welliving
3
580
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
4
960
クラウドに依存しないS3を使った開発術
simesaba80
0
160
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
450
Grafana:建立系統全知視角的捷徑
blueswen
0
200
TestingOsaka6_Ozono
o3
0
170
Featured
See All Featured
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
68
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Documentation Writing (for coders)
carmenintech
77
5.2k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
230
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
190
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Designing for Timeless Needs
cassininazir
0
93
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Docker and Python
trallard
47
3.7k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
Reality Check: Gamification 10 Years Later
codingconduct
0
1.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
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