barely changed since 0.9x and was frustrating to work with. New API is leaner, simpler, more explicit, more correct. Easier, fine-grained rollbacks between savepoints. Easier error management.
o c o m m i t is now turned on by default: Every SQL statement gets committed right away. Detailed upgrading instructions: For more details, see Aymeric Augustin's DjangoCon Europe talk: http://tinyurl.com/transactions-upgrade http://tinyurl.com/djangocon-eu-transactions
a n s a c t i o n . a t o m i c : Commits on success, rolls back on exceptions. Inspired from http://tinyurl.com/django-atomic https://github.com/Xof/xact
manager: Can be nested. f r o m d j a n g o . d b i m p o r t t r a n s a c t i o n @ t r a n s a c t i o n . a t o m i c d e f v i e w f u n c ( r e q u e s t ) : # T h i s c o d e e x e c u t e s i n s i d e a t r a n s a c t i o n . d o _ s t u f f ( ) f r o m d j a n g o . d b i m p o r t t r a n s a c t i o n d e f v i e w f u n c ( r e q u e s t ) : # T h i s c o d e e x e c u t e s i n a u t o c o m m i t m o d e # ( D j a n g o ' s d e f a u l t ) . d o _ s t u f f ( ) w i t h t r a n s a c t i o n . a t o m i c ( ) : # T h i s c o d e e x e c u t e s i n s i d e a t r a n s a c t i o n . d o _ m o r e _ s t u f f ( )
for each HTTP request. Now: Same connection reused between requests. One connection per worker thread. New setting: C O N N _ M A X _ A G E (defaults to 0 , i.e. turned off by default) Not as powerful as or ... ... but should still drastically improve performance (See Craig Kerstiens' blog post: ) Caveat: Not extensively tested in production yet... PgBouncer PgPool http://tinyurl.com/fixing-connections
Before: Run all tests in an app, all tests in a certain T e s t C a s e or one test method. Now: Run all tests within a certain directory (recursively), all tests in a certain test file, or all tests in a certain T e s t C a s e , or a particular test method.
a p p / t e s t s / _ _ i n i t _ _ . p y : f r o m a a a a a a a i m p o r t * f r o m b b b b b b b b b i m p o r t * f r o m c c c c i m p o r t * f r o m d d d d d d d i m p o r t * f r o m e e e e e e i m p o r t * f r o m f f f i m p o r t *
. p y must be moved to a t e s t * . p y file. Doctests must be explicitly loaded: New runner enabled by default. To revert to the old behavior: http://tinyurl.com/load-doctests T E S T _ R U N N E R = ' d j a n g o . t e s t . s i m p l e . D j a n g o T e s t S u i t e R u n n e r '
Q u e r y s e t . e a r l i e s t ( ) , . f i r s t ( ) and . l a s t ( ) Database lookups by hour, minute, second BinaryField M o d e l A d m i n . p r e s e r v e _ f i l t e r s HTML5 types for input fields (email, url, number) Admin's jQuery upgraded to 1.9.1 Multiple documentation improvements, including a And many, many small features... Many bug fixes... deployment checklist
enabled by default. B o o l e a n F i e l d now defaults N o n e instead of F a l s e . Whole list: Should be easy to upgrade for most people. http://tinyurl.com/transactions-incompatible http://tinyurl.com/django-1-6-incompatible
markup & localflavor. django.utils.text.truncate_words() and django.utils.text.truncate_html_words() removed in favor of the django.utils.text.Truncator class Detailed list of past deprecations: http://tinyurl.com/django-1-6-removed
apps against the 1.6 beta release or the 1.6.x branch on Github. any regressions or bugs in new features. Help triage in Trac. Contribution guide: Report unreviewed tickets http://tinyurl.com/django-contribute