The first five years

Jacob Kaplan-Moss

Google, December 16, 2008
http://jacobian.org/speaking/2008/first-five-years/
“
Good software takes ten years.
       Get used to it.



                            — Joel Spolsky
                    ...
Halfway there!




                 http://flickr.com/photos/usonian/257403571/
Kansas
Merry Slickmas              Events     Latest     Music     Movies      Food      Nightlife




   Best bets    Upcoming

...
“
    In the beginning there was Zope. Zope
    was a web application framework ... but
     it had some discontents who d...
2003
2008
r36 cms/apps/polls/

 r84 cms/core/validators.py

r159 cms/core/paginator.py

r327 cms/apps/auth/

r390 cms/core/urlresolv...
February 2004
    circa r1000
cms/apps/polls/poll.py
>>>
from
cms.apps.polls.polls
import
Poll
>>>
p
=
Poll(4,
quot;hiquot;,
date(2004,
1,
1),
...)
>>>
p.save()
cms/apps/polls/polls.py
cms/apps/polls/polls.py
cms/apps/polls/dblayout.sql
httpd.conf
cms/conf/mrmustard/polls.py
cms/views/polls/polls.py
Data class                 Admin view




Data-access function(s)         Admin template




                   Admin URLs
cms/datadescriptions/polls.py
./generate_code.py
polls
apps/
   polls.py

sql/
   polls.sql

views/
   admin/
      polls.py

templates/
   admin/
      polls/
         change_l...
cms/utilities/codegeneration/generation.py
cms/datadescriptions/polls.py
DO
NOT
EDIT
THIS
FILE
MANUALLY.
IT
WAS
GENERATED
BY
A
PROGRAM.
RE‐RUN
THE
CODE
GENERATOR
INSTEAD.
Seven months later...
       October 2004
cms/models/polls.py
PyCon 2005
Rails
class
Poll(meta.Model):




fields
=
(








meta.SlugField('slug',
'slug',
unique_for_month='pub_dat








meta.CharF...
class
Poll(meta.Model):




slug
=
meta.SlugField(unique_for_month='pub_date')




question
=
meta.CharField(maxlength=255...
“    I can't think of any other
    backwards-incompatible
  changes that we're planning
before 1.0 (knock on wood). If
 t...
Before:
from
django.models.polls
import
Poll

After:
from
myapp.models
import
Poll
Before:
...
magic!
...

After:
import
datetime
Before:
class
Poll(meta.Model):




class
META:








admin
=
meta.Admin(












list_display
=
('title'),








...
Before:
from
django.models.polls
import
polls
polls.get_list(slug__exact='slug')

After:
from
polls.models
import
Poll
Pol...

339
files
changed,

22290
insertions(+),

 15656
deletions(‐)
“   After this merge,
Django 1.0 can’t be far off.



                                — Bill de hÓra
                     ...
“0.95”
django.newforms

  django.test
18 months
3,094 commits
    + branches
1,370 from the
  community
230 new AUTHORS
2,120 bugs fixed

1,394
files
changed,

28,3237
insertions(+),

 97,036
deletions(‐)
40,000 lines of new
  documentation
4 new full committers
Unicode
QSRF
NFA
GeoDjango
ModelForms
Autoescaping
Django on Jython
    (Thanks, Google!)
... and much more ...
http://docs.djangoproject.com/en/dev/releases/1.0/
API stability &
forwards-compatability
http://docs.djangoproject.com/en/dev/misc/api-stability/
Formal release process
http://docs.djangoproject.com/en/dev/internals/release-process/
What’s next?
Django 1.1
 March 16, 2009
Django 1.1 Roadmap
http://code.djangoproject.com/wiki/Version1.1Roadmap
ORM aggregation
http://github.com/freakboy3742/django/tree/aggregation
>>>
Book.objects.aggregate(
...




Avg('price'),
...




highest_price
=
Max('price'))

{'price_avg':
45.0,
'highest_pric...
>>>
Author.objects.aggregate(Sum('book__price'))

{'book_price_sum':
442}
>>>
books
=
Book.objects.annotate(Max('authors__age'))

>>>
books[0].name
u'Python
Web
Development
With
Django'

>>>
books...
Publisher.objects.annotate(num_books=Count('book__id'))


















.filter(num_books__gt=1)


















.orde...
Improved
QuerySet.update()
>>>
Person.objects.update(age=F('age')+1)
Model Validation
http://code.djangoproject.com/ticket/6845
>>>
p
=
Person.objects.get(...)
>>>
p.age
=
‐7
>>>
p.save(validate=True)
Traceback
(most
recent
call
last):


File
quot;<s...
Bulk admin actions
http://code.google.com/p/django-batchadmin/
Class-based
generic views
from
django.views.generic
import
DetailView

class
PersonView(DetailView):




queryset
=
Person.objects.all()









de...
... and more ...
http://code.djangoproject.com/wiki/Version1.1Roadmap
Please help!
http://code.djangoproject.com/wiki/Version1.1Roadmap#how-you-can-help
Thank you!
 jacob@jacobian.org
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Django - the first five years
Upcoming SlideShare
Loading in...5
×

Django - the first five years

15,871

Published on

Published in: Technology, Design
1 Comment
4 Likes
Statistics
Notes
No Downloads
Views
Total Views
15,871
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
76
Comments
1
Likes
4
Embeds 0
No embeds

No notes for slide

Django - the first five years

  1. 1. The first five years Jacob Kaplan-Moss Google, December 16, 2008 http://jacobian.org/speaking/2008/first-five-years/
  2. 2. “ Good software takes ten years. Get used to it. — Joel Spolsky ” http://www.joelonsoftware.com/articles/fog0000000017.html
  3. 3. Halfway there! http://flickr.com/photos/usonian/257403571/
  4. 4. Kansas
  5. 5. Merry Slickmas Events Latest Music Movies Food Nightlife Best bets Upcoming quot;A Benefit for Charley's Fingerquot; with The Dactyls / Naomi What? Charlie Downey is a baller. He's so badass that he broke his finger in two places when one of his shots got stuffed Today at 10:00pm The Jackpot Music Hall, $5 Today's events Search events Staph blogs O Caption! My Caption! The Dog and Pony Show Loafers of Mass Destruction 13 comments Hark! The Local Musicians Sing!: New Christmas albums from Sam Billen and Josh Atkinson Scene Stealers Sam Billen’s “Merry Christmas” and Josh Atkinson’s “Songs for Christmas” rank right up 'Synecdoche, New York' tackles life’s there with recent yuletide blessings from Sufjan Stevens and Low. Both albums strip away complexity with complexity
  6. 6. “ In the beginning there was Zope. Zope was a web application framework ... but it had some discontents who dared to call it quot;monolithicquot; and quot;unpythonicquot;. And behold, then there came Webware, and it was Modular.... But others rebelled ... and a Ton of frameworks appeared: Quixote ... SkunkWEB ... ” CherryPy ... and some thirteen others. — Mike Orr http://linuxgazette.net/113/orr.html
  7. 7. 2003
  8. 8. 2008
  9. 9. r36 cms/apps/polls/ r84 cms/core/validators.py r159 cms/core/paginator.py r327 cms/apps/auth/ r390 cms/core/urlresolvers.py r630 cms/core/sites.py
  10. 10. February 2004 circa r1000
  11. 11. cms/apps/polls/poll.py
  12. 12. >>>
from
cms.apps.polls.polls
import
Poll >>>
p
=
Poll(4,
quot;hiquot;,
date(2004,
1,
1),
...) >>>
p.save()
  13. 13. cms/apps/polls/polls.py
  14. 14. cms/apps/polls/polls.py
  15. 15. cms/apps/polls/dblayout.sql
  16. 16. httpd.conf
  17. 17. cms/conf/mrmustard/polls.py
  18. 18. cms/views/polls/polls.py
  19. 19. Data class Admin view Data-access function(s) Admin template Admin URLs
  20. 20. cms/datadescriptions/polls.py
  21. 21. ./generate_code.py
polls
  22. 22. apps/ polls.py sql/ polls.sql views/ admin/ polls.py templates/ admin/ polls/ change_list.html add_form.html change_form.html
  23. 23. cms/utilities/codegeneration/generation.py
  24. 24. cms/datadescriptions/polls.py
  25. 25. DO
NOT
EDIT
THIS
FILE
MANUALLY. IT
WAS
GENERATED
BY
A
PROGRAM. RE‐RUN
THE
CODE
GENERATOR
INSTEAD.
  26. 26. Seven months later... October 2004
  27. 27. cms/models/polls.py
  28. 28. PyCon 2005
  29. 29. Rails
  30. 30. class
Poll(meta.Model): 



fields
=
( 







meta.SlugField('slug',
'slug',
unique_for_month='pub_dat 







meta.CharField('question',
'question',
maxlength=255), 







meta.DateTimeField('pub_date',
'date
published'), 







meta.DateTimeField('expire_date',
'expiration
date'), 







meta.ManyToManyField(core.Site), 







meta.PositiveSmallIntegerField('choice_votes',
'choice
v 



) 



db_table
=
polls 



ordering
=
('‐pub_date',) 



get_latest_by
=
'pub_date'
  31. 31. class
Poll(meta.Model): 



slug
=
meta.SlugField(unique_for_month='pub_date') 



question
=
meta.CharField(maxlength=255) 



pub_date
=
meta.DateTimeField('date
published') 



expire_date
=
meta.DateTimeField('expiration
date') 



sites
=
meta.ManyToManyField(core.Site) 



choice_votes
=
meta.PositiveSmallIntegerField(default=1) 



class
META: 







db_table
=
'polls' 







ordering
=
('‐pub_date',)
  32. 32. “ I can't think of any other backwards-incompatible changes that we're planning before 1.0 (knock on wood). If this isn't the last one, though, it's at least the last major one. — Adrian, August 2005 ” http://www.djangoproject.com/weblog/2005/aug/25/modelsyntax/
  33. 33. Before: from
django.models.polls
import
Poll After: from
myapp.models
import
Poll
  34. 34. Before: ...
magic!
... After: import
datetime
  35. 35. Before: class
Poll(meta.Model): 



class
META: 







admin
=
meta.Admin( 











list_display
=
('title'), 







) After: class
Poll(meta.Model): 



class
Admin 







list_display
=
('title')
  36. 36. Before: from
django.models.polls
import
polls polls.get_list(slug__exact='slug') After: from
polls.models
import
Poll Poll.objects.filter(slug='slug')
  37. 37. 
339
files
changed,
 22290
insertions(+),
 15656
deletions(‐)
  38. 38. “ After this merge, Django 1.0 can’t be far off. — Bill de hÓra ” http://www.dehora.net/journal/2006/04/django_magic_merging.html
  39. 39. “0.95”
  40. 40. django.newforms django.test
  41. 41. 18 months
  42. 42. 3,094 commits + branches
  43. 43. 1,370 from the community
  44. 44. 230 new AUTHORS
  45. 45. 2,120 bugs fixed
  46. 46. 
1,394
files
changed,
 28,3237
insertions(+),
 97,036
deletions(‐)
  47. 47. 40,000 lines of new documentation
  48. 48. 4 new full committers
  49. 49. Unicode
  50. 50. QSRF
  51. 51. NFA
  52. 52. GeoDjango
  53. 53. ModelForms
  54. 54. Autoescaping
  55. 55. Django on Jython (Thanks, Google!)
  56. 56. ... and much more ... http://docs.djangoproject.com/en/dev/releases/1.0/
  57. 57. API stability & forwards-compatability http://docs.djangoproject.com/en/dev/misc/api-stability/
  58. 58. Formal release process http://docs.djangoproject.com/en/dev/internals/release-process/
  59. 59. What’s next?
  60. 60. Django 1.1 March 16, 2009
  61. 61. Django 1.1 Roadmap http://code.djangoproject.com/wiki/Version1.1Roadmap
  62. 62. ORM aggregation http://github.com/freakboy3742/django/tree/aggregation
  63. 63. >>>
Book.objects.aggregate( ...




Avg('price'), ...




highest_price
=
Max('price')) {'price_avg':
45.0,
'highest_price':
82.80}
  64. 64. >>>
Author.objects.aggregate(Sum('book__price')) {'book_price_sum':
442}
  65. 65. >>>
books
=
Book.objects.annotate(Max('authors__age')) >>>
books[0].name u'Python
Web
Development
With
Django' >>>
books[0].authors.all() [<Author:
Jeffrey
Forcier
>,
<Author:
Paul
Bissex>,
 <Author:
Wesley
J.
Chun>] >>>
books[0].authors__age__max 37.0
  66. 66. Publisher.objects.annotate(num_books=Count('book__id'))
 
















.filter(num_books__gt=1)
 
















.order_by('num_books')
  67. 67. Improved QuerySet.update()
  68. 68. >>>
Person.objects.update(age=F('age')+1)
  69. 69. Model Validation http://code.djangoproject.com/ticket/6845
  70. 70. >>>
p
=
Person.objects.get(...) >>>
p.age
=
‐7 >>>
p.save(validate=True) Traceback
(most
recent
call
last): 

File
quot;<stdin>quot;,
line
1,
in
<module> ValidationError:
enter
a
number
greater
than
0.
  71. 71. Bulk admin actions http://code.google.com/p/django-batchadmin/
  72. 72. Class-based generic views
  73. 73. from
django.views.generic
import
DetailView class
PersonView(DetailView): 



queryset
=
Person.objects.all() 



 



def
get_template(self,
request): 







return
Template(...)
  74. 74. ... and more ... http://code.djangoproject.com/wiki/Version1.1Roadmap
  75. 75. Please help! http://code.djangoproject.com/wiki/Version1.1Roadmap#how-you-can-help
  76. 76. Thank you! jacob@jacobian.org
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×