Commits

Anonymous committed 581970a

multi-auth: Merged to [3085]

Comments (0)

Files changed (80)

django/conf/global_settings.py

 # http://www.djangoproject.com/documentation/templates/#now
 TIME_FORMAT = 'P'
 
+# Default formatting for date objects when only the year and month are relevant.
+# See all available format strings here:
+# http://www.djangoproject.com/documentation/templates/#now
+YEAR_MONTH_FORMAT = 'F Y'
+
+# Default formatting for date objects when only the month and day are relevant.
+# See all available format strings here:
+# http://www.djangoproject.com/documentation/templates/#now
+MONTH_DAY_FORMAT = 'F j'
+
 # Whether to enable Psyco, which optimizes Python code. Requires Psyco.
 # http://psyco.sourceforge.net/
 ENABLE_PSYCO = False

django/conf/locale/nl/LC_MESSAGES/django.mo

Binary file modified.

django/conf/locale/nl/LC_MESSAGES/django.po

 
 #: db/models/fields/__init__.py:468 core/validators.py:132
 msgid "Enter a valid date/time in YYYY-MM-DD HH:MM format."
-msgstr "Geef geldige datum/tijd in JJJJ-MM-DD HH:MM formaat."
+msgstr "Geef geldige datum/tijd in JJJJ-MM-DD UU:MM formaat."
 
 #: db/models/fields/__init__.py:562
 msgid "Enter a valid filename."
 
 #: conf/global_settings.py:46
 msgid "Galician"
-msgstr "Galisisch"
+msgstr "Galicisch"
 
 #: conf/global_settings.py:47
 msgid "Hungarian"
 
 #: conf/global_settings.py:61
 msgid "Ukrainian"
-msgstr "Ukraiens"
+msgstr "Oekraïens"
 
 #: conf/global_settings.py:62
 msgid "Simplified Chinese"
 
 #: core/validators.py:103
 msgid "Empty values are not allowed here."
-msgstr "Lege waarden niet toegestaan."
+msgstr "Lege waarden zijn hier niet toegestaan."
 
 #: core/validators.py:107
 msgid "Non-numeric characters aren't allowed here."
-msgstr "Niet-numerieke karakters niet toegestaan."
+msgstr "Niet-numerieke karakters zijn hier niet toegestaan."
 
 #: core/validators.py:111
 msgid "This value can't be comprised solely of digits."
 
 #: core/validators.py:128
 msgid "Enter a valid time in HH:MM format."
-msgstr "Geef een geldige tijd in HH:MM formaat."
+msgstr "Geef een geldige tijd in UU:MM formaat."
 
 #: core/validators.py:136
 msgid "Enter a valid e-mail address."
 
 #: core/validators.py:255
 msgid "Please enter something for at least one field."
-msgstr "Geef in minimaal één veld een waarde."
+msgstr "Voer tenminste één veld in."
 
 #: core/validators.py:264 core/validators.py:275
 msgid "Please enter both fields or leave them both empty."
 msgid "Please enter a valid decimal number with at most %s total digit."
 msgid_plural ""
 "Please enter a valid decimal number with at most %s total digits."
-msgstr[0] "Geef een geldig decimaal getal met maximaal %s cijfer."
-msgstr[1] "Geef een geldig decimaal getal met maximaal %s cijfers."
+msgstr[0] "Geef een geldig decimaal getal met hooguit %s cijfer."
+msgstr[1] "Geef een geldig decimaal getal met hooguit %s cijfers."
 
 #: core/validators.py:352
 #, python-format
 msgid "Please enter a valid decimal number with at most %s decimal place."
 msgid_plural ""
 "Please enter a valid decimal number with at most %s decimal places."
-msgstr[0] "Geef een decimaal getal met maximaal %s cijfer achter de komma."
-msgstr[1] "Geef een decimaal getal met maximaal %s cijfers achter de komma."
+msgstr[0] "Geef een decimaal getal met hooguit %s cijfer achter de komma."
+msgstr[1] "Geef een decimaal getal met hooguit %s cijfers achter de komma."
 
 #: core/validators.py:362
 #, python-format
 msgid "Make sure your uploaded file is at least %s bytes big."
-msgstr "Zorg ervoor dat het bestand minimaal %s bytes groot is."
+msgstr "Zorg ervoor dat het bestand minstens %s bytes groot is."
 
 #: core/validators.py:363
 #, python-format
 msgid "Make sure your uploaded file is at most %s bytes big."
-msgstr "Zorg ervoor dat het bestand maximaal %s bytes groot is."
+msgstr "Zorg ervoor dat het bestand hoogstens %s bytes groot is."
 
 #: core/validators.py:376
 msgid "The format for this field is wrong."
 "Your Web browser doesn't appear to have cookies enabled. Cookies are "
 "required for logging in."
 msgstr ""
-"Het lijkt erop dat uw browser geen cookies accepteerd. Om u aan te melden "
+"Het lijkt erop dat uw browser geen cookies accepteerd. Om aan te melden "
 "moeten cookies worden geaccepteerd."
 
 #: contrib/auth/forms.py:36 contrib/auth/forms.py:41
 "Please enter a correct username and password. Note that both fields are case-"
 "sensitive."
 msgstr ""
-"Geef een correcte gebruikersnaam en wachtwoord. Let op de velden zijn "
+"Voer een correcte gebruikersnaam en wachtwoord in. Let op, de velden zijn "
 "hoofdletter-gevoelig."
 
 #: contrib/auth/models.py:13 contrib/auth/models.py:26
 
 #: contrib/auth/models.py:60
 msgid "Designates whether the user can log into this admin site."
-msgstr "Bepaalt of de gebruiker kan inloggen op deze admin site"
+msgstr "Bepaalt of de gebruiker kan inloggen op deze admin site."
 
 #: contrib/auth/models.py:61
 msgid "active"
 #: contrib/admin/views/decorators.py:84
 #, python-format
 msgid "Your e-mail address is not your username. Try '%s' instead."
-msgstr "Uw e-mail adres is niet uw gebruikersnaam. Probeer '%s' eens."
+msgstr "Uw e-mailadres is niet uw gebruikersnaam. Probeer '%s' eens."
 
 #: contrib/admin/views/main.py:226
 msgid "Site administration"
 #: contrib/admin/views/main.py:346
 #, python-format
 msgid "The %(name)s \"%(obj)s\" was changed successfully."
-msgstr "Wijzigen %(name)s \"%(obj)s\" is geslaagd."
+msgstr "Het wijzigen van %(name)s \"%(obj)s\" is geslaagd."
 
 #: contrib/admin/views/main.py:354
 #, python-format
 msgid ""
 "The %(name)s \"%(obj)s\" was added successfully. You may edit it again below."
-msgstr "De %(name)s \"%(obj)s\" toegevoegd. U kunt het hieronder wijzigen."
+msgstr "De %(name)s \"%(obj)s\" was toegevoegd. U kunt het hieronder wijzigen."
 
 #: contrib/admin/views/main.py:392
 #, python-format
 #: contrib/admin/views/main.py:508
 #, python-format
 msgid "The %(name)s \"%(obj)s\" was deleted successfully."
-msgstr "Verwijdering %(name)s \"%(obj)s\" is geslaagd."
+msgstr "De verwijdering van %(name)s \"%(obj)s\" is geslaagd."
 
 #: contrib/admin/views/main.py:511
 msgid "Are you sure?"
 #: contrib/admin/views/main.py:533
 #, python-format
 msgid "Change history: %s"
-msgstr "Wijzigingshistorie: %s"
+msgstr "Wijzigingsgeschiedenis: %s"
 
 #: contrib/admin/views/main.py:565
 #, python-format
 #: contrib/admin/views/doc.py:279 contrib/admin/views/doc.py:296
 #, python-format
 msgid "String (up to %(maxlength)s)"
-msgstr "Karakterreeks (maximaal %(maxlength)s)"
+msgstr "Karakterreeks (hooguit %(maxlength)s)"
 
 #: contrib/admin/views/doc.py:280
 msgid "Comma-separated integers"
 "objects, but your account doesn't have permission to delete the following "
 "types of objects:"
 msgstr ""
-"Verwijderen van %(object_name)s '%(object)s' zal ook gerelateerde objecten "
-"verwijderen. Echter u heeft geen rechten om de volgende typen objecten te "
-"verwijderen:"
+"Het verwijderen van %(object_name)s '%(object)s' zal ook gerelateerde "
+"objecten verwijderen. Echter u heeft geen rechten om de volgende typen "
+"objecten te verwijderen:"
 
 #: contrib/admin/templates/admin/delete_confirmation.html:21
 #, python-format
 
 #: contrib/admin/templates/admin/404.html:10
 msgid "We're sorry, but the requested page could not be found."
-msgstr "De gevraagde pagina komt niet voor."
+msgstr "Onze excuses, maar de gevraagde pagina komt niet voor."
 
 #: contrib/admin/templates/admin/change_form.html:15
 #: contrib/admin/templates/admin/index.html:28
 "This object doesn't have a change history. It probably wasn't added via this "
 "admin site."
 msgstr ""
-"Dit object heeft geen geschiedenis. Mogelijk niet via de admin site "
-"toegevoegd."
+"Dit object heeft geen wijzigingsgeschiedenis. Het is mogelijk niet via de "
+"admin site toegevoegd."
 
 #: contrib/admin/templates/admin/500.html:4
 msgid "Server error"
 "There's been an error. It's been reported to the site administrators via e-"
 "mail and should be fixed shortly. Thanks for your patience."
 msgstr ""
-"Er is een fout opgetreden. Dit is inmiddels doorgegevens aan de "
-"sitebeheerder via e-mail en zal binnenkort worden gerepareerd. Bedankt voor "
-"uw geduld"
+"Er is een fout opgetreden. Dit is inmiddels doorgegeven aan de sitebeheerder "
+"via e-mail en zal spoedig worden gerepareerd. Bedankt voor uw geduld."
 
 #: contrib/admin/templates/admin/search_form.html:8
 msgid "Go"
 
 #: contrib/admin/templates/admin_doc/bookmarklets.html:29
 msgid "As above, but opens the admin page in a new window."
-msgstr "Als boven, maar opent de beheerpagina in een nieuw venster."
+msgstr "Zoals hierboven, maar opent de beheerpagina in een nieuw venster."
 
 #: contrib/admin/templates/widget/date_time.html:3
 msgid "Date:"
 "Forgotten your password? Enter your e-mail address below, and we'll reset "
 "your password and e-mail the new one to you."
 msgstr ""
-"Wachtwoord vergeten? Geef u e-mail adres op en we herstellen uw wachtwoord "
-"en zullen u het nieuwe wachtwoord per e-mail toesturen."
+"Uw wachtwoord vergeten? Geef uw e-mailadres op en er zal een nieuw "
+"wachtwoord worden toegekend en aan u worden toegezonden."
 
 #: contrib/admin/templates/registration/password_reset_form.html:16
 msgid "E-mail address:"
 
 #: contrib/admin/templates/registration/password_reset_email.html:2
 msgid "You're receiving this e-mail because you requested a password reset"
-msgstr "U krijgt een e-mail omdat u om een nieuw wachtwoord heeft gevraagd"
+msgstr "U krijgt deze e-mail omdat u om een nieuw wachtwoord heeft gevraagd"
 
 #: contrib/admin/templates/registration/password_reset_email.html:3
 #, python-format
 "We've e-mailed a new password to the e-mail address you submitted. You "
 "should be receiving it shortly."
 msgstr ""
-"Een nieuw wachtwoord is per e-mail verstuurd. U zult het binnenkort "
-"ontvangen."
+"Een nieuw wachtwoord is per e-mail verstuurd. U zult het spoedig ontvangen."
 
 #: contrib/admin/templates/registration/password_change_form.html:4
 #: contrib/admin/templates/registration/password_change_form.html:6
 "Please enter your old password, for security's sake, and then enter your new "
 "password twice so we can verify you typed it in correctly."
 msgstr ""
-"Geef voor de veiligheid uw oude wachtwoord op en twee keer een nieuw "
-"wachtwoord, zodat we kunnen controleren of er geen typefouten zijn gemaakt."
+"Vanwege de beveiliging moet u uw oude en twee keer een nieuw wachtwoord"
+"invoeren, zodat we kunnen controleren of er geen typefouten zijn gemaakt."
 
 #: contrib/admin/templates/registration/password_change_form.html:17
 msgid "Old password:"
 #: contrib/flatpages/models.py:8
 msgid ""
 "Example: '/about/contact/'. Make sure to have leading and trailing slashes."
-msgstr "Voorbeeld: '/about/contact/'. Zorg voor slashes aan begin en eind"
+msgstr ""
+"Voorbeeld: '/about/contact/'. Zorg voor slashes aan het begin en eind."
 
 #: contrib/flatpages/models.py:9
 msgid "title"
 #: contrib/flatpages/models.py:14
 msgid "If this is checked, only logged-in users will be able to view the page."
 msgstr ""
-"Alleen ingelogde gebruikers kunnen deze pagina zien, indien dit is "
-"aangekruist."
+"Indien dit is aangekruist kunnen alleen ingelogde gebruikers deze pagina "
+"bekijken."
 
 #: contrib/flatpages/models.py:18
 msgid "flat page"
 "This can be either an absolute path (as above) or a full URL starting with "
 "'http://'."
 msgstr ""
-"Dit kan een absoluut pad zijn (zoals boven) of een volledige URL beginnend "
-"met 'http://'."
+"Dit kan een absoluut pad (zoals hierboven) zijn of een volledige URL "
+"beginnend met 'http://'."
 
 #: contrib/redirects/models.py:12
 msgid "redirect"
 
 #: contrib/comments/models.py:84 contrib/comments/models.py:170
 msgid "is public"
-msgstr "is publiek"
+msgstr "is openbaar"
 
 #: contrib/comments/models.py:86
 msgid "is removed"
 
 #: contrib/comments/models.py:173
 msgid "approved by staff"
-msgstr "goegekeurd door de staf"
+msgstr "goedgekeurd door de staf"
 
 #: contrib/comments/models.py:176
 msgid "free comment"
 
 #: contrib/comments/views/karma.py:25
 msgid "No voting for yourself"
-msgstr "Niet op jezelf stemmen"
+msgstr "Niet op uzelf stemmen"
 
 #: contrib/comments/views/comments.py:28
 msgid ""
 "This rating is required because you've entered at least one other rating."
 msgstr ""
-"Deze waardering is verplicht omdat je op zijn minst een andere waardering "
-"hebt ingevoerd."
+"Deze waardering is verplicht omdat u tenminste één andere waardering hebt "
+"ingevoerd."
 
 #: contrib/comments/views/comments.py:112
 #, python-format
 "\n"
 "%(text)s"
 msgstr[0] ""
-"Deze opmerking is gepost door een gebruiker welke minder dan %(count)s opmerking "
-"heeft gepost:\n"
+"Deze opmerking is gepost door een gebruiker die minder dan %(count)s "
+"opmerking heeft gepost:\n"
 "\n"
 "%(text)s"
 msgstr[1] ""
-"Deze opmerking is gepost door een gebruiker welke minder dan %(count)s opmerkingen "
-"heeft gepost:\n"
+"Deze opmerking is gepost door een gebruiker die minder dan %(count)s "
+"opmerkingen heeft gepost:\n"
 "\n"
 "%(text)s"
 
 #: contrib/comments/views/comments.py:193
 #: contrib/comments/views/comments.py:284
 msgid "One or more of the required fields wasn't submitted"
-msgstr "Een of meerdere verplichte velden is niet ingevuld"
+msgstr "Een of meerdere verplichte velden zijn niet ingevuld"
 
 #: contrib/comments/views/comments.py:197
 #: contrib/comments/views/comments.py:286
 
 #: contrib/comments/templates/comments/freeform.html:4
 msgid "Your name:"
-msgstr "Uw gebruikernaam:"
+msgstr "Uw gebruikersnaam:"
 
 #: contrib/sessions/models.py:35
 msgid "session key"
 
 #: contrib/contenttypes/models.py:28
 msgid "content type"
-msgstr "inhoudtype"
+msgstr "inhoudstype"
 
 #: contrib/contenttypes/models.py:29
 msgid "content types"
-msgstr "inhoudtypen"
+msgstr "inhoudstypen"
 
 #: forms/__init__.py:380
 #, python-format
 msgid "Ensure your text is less than %s character."
 msgid_plural "Ensure your text is less than %s characters."
-msgstr[0] "Zorg ervoor dat uw tekst korter is dan %s teken."
-msgstr[1] "Zorg ervoor dat uw tekst korter is dan %S tekens."
+msgstr[0] "Zorg ervoor dat uw tekst korter is dan %s karakter."
+msgstr[1] "Zorg ervoor dat uw tekst korter is dan %s karakters."
 
 #: forms/__init__.py:385
 msgid "Line breaks are not allowed here."
 
 #: utils/dates.py:6
 msgid "Monday"
-msgstr "Maandag"
+msgstr "maandag"
 
 #: utils/dates.py:6
 msgid "Tuesday"
-msgstr "Dinsdag"
+msgstr "dinsdag"
 
 #: utils/dates.py:6
 msgid "Wednesday"
-msgstr "Woensdag"
+msgstr "woensdag"
 
 #: utils/dates.py:6
 msgid "Thursday"
-msgstr "Donderdag"
+msgstr "donderdag"
 
 #: utils/dates.py:6
 msgid "Friday"
-msgstr "Vrijdag"
+msgstr "vrijdag"
 
 #: utils/dates.py:7
 msgid "Saturday"
-msgstr "Zaterdag"
+msgstr "zaterdag"
 
 #: utils/dates.py:7
 msgid "Sunday"
-msgstr "Zondag"
+msgstr "zondag"
 
 #: utils/dates.py:14
 msgid "January"
 
 #: utils/dates.py:20
 msgid "oct"
-msgstr "oct"
+msgstr "okt"
 
 #: utils/dates.py:20
 msgid "nov"

django/conf/urls/registration.py

 from django.conf.urls.defaults import *
 
 urlpatterns = patterns('',
-    (r'^login/$', 'django.contrib.auth.view.login'),
+    (r'^login/$', 'django.contrib.auth.views.login'),
     (r'^logout/$', 'django.contrib.auth.views.logout'),
     (r'^login_another/$', 'django.contrib.auth.views.logout_then_login'),
 

django/contrib/admin/media/css/changelists.css

 #changelist { position:relative; width:100%; }
 #changelist table { width:100%; }
 .change-list .filtered table { border-right:1px solid #ddd;  }
-.change-list .filtered { min-height:400px; _height:400px; }
+.change-list .filtered { min-height:400px; }
 .change-list .filtered { background:white url(../img/admin/changelist-bg.gif) top right repeat-y !important; }
 .change-list .filtered table, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { margin-right:160px !important; width:auto !important; }
 .change-list .filtered table tbody th { padding-right:1em; }
 #changelist-filter { position:absolute; top:0; right:0; z-index:1000; width:160px; border-left:1px solid #ddd; background:#efefef; margin:0; }
 #changelist-filter h2 { font-size:11px; padding:2px 5px; border-bottom:1px solid #ddd; }
 #changelist-filter h3 { font-size:12px; margin-bottom:0; }
-#changelist-filter ul { padding-left:0;margin-left:10px;_margin-right:-10px; }
+#changelist-filter ul { padding-left:0;margin-left:10px; }
 #changelist-filter li { list-style-type:none; margin-left:0; padding-left:0; }
 #changelist-filter a { color:#999; }
 #changelist-filter a:hover { color:#036; }

django/contrib/admin/media/css/global.css

 input[type=text], input[type=password], textarea, select, .vTextField { border:1px solid #ccc; }
 
 /*  FORM BUTTONS  */
-input[type=submit], input[type=button], .submit-row input { background:white url(../img/admin/nav-bg.gif) bottom repeat-x; padding:3px; color:black; }
+input[type=submit], input[type=button], .submit-row input { background:white url(../img/admin/nav-bg.gif) bottom repeat-x; padding:3px; color:black; border:1px solid #bbb; border-color:#ddd #aaa #aaa #ddd; }
 input[type=submit]:active, input[type=button]:active { background-image:url(../img/admin/nav-bg-reverse.gif); background-position:top; }
 input[type=submit].default, .submit-row input.default { border:2px solid #5b80b2; background:#7CA0C7 url(../img/admin/default-bg.gif) bottom repeat-x; font-weight:bold; color:white; }
 input[type=submit].default:active { background-image:url(../img/admin/default-bg-reverse.gif); background-position:top; }

django/contrib/admin/media/css/layout.css

 #content { margin:10px 15px; }
 #header { width:100%; }
 #content-main { float:left; width:100%; }
-#content-related { float:right; width:220px; position:relative; margin-right:-230px; }
+#content-related { float:right; width:18em; position:relative; margin-right:-19em; }
 #footer	{ clear:both; padding:10px; }
 
 /*  COLUMN TYPES  */
-.colMS { margin-right:245px !important; }
-.colSM { margin-left:245px !important; }
-.colSM #content-related { float:left; margin-right:0; margin-left:-230px; }
+.colMS { margin-right:20em !important; }
+.colSM { margin-left:20em !important; }
+.colSM #content-related { float:left; margin-right:0; margin-left:-19em; }
 .colSM #content-main { float:right; }
 .popup .colM { width:95%; }
 .subcol { float:left; width:46%; margin-right:15px; }

django/contrib/admin/media/css/patch-iewin.css

 * html .colSM #content-related { margin-right:10px; margin-left:-115px; position:static; } /* put the left sidebars back on the page */
 * html .form-row { height:1%; }
 * html .dashboard #content { width:768px; } /* proper fixed width for dashboard in IE6 */
-* html .dashboard #content-main { width:535px; } /* proper fixed width for dashboard in IE6 */
+* html .dashboard #content-main { width:535px; } /* proper fixed width for dashboard in IE6 */
+* html #changelist-filter ul { margin-right:-10px; } /* fix right margin for changelist filters in IE6 */
+* html .change-list .filtered { height:400px; } /* IE ignores min-height, but treats height as if it were min-height */

django/contrib/admin/media/js/admin/RelatedObjectLookups.js

 
 function showRelatedObjectLookupPopup(triggeringLink) {
     var name = triggeringLink.id.replace(/^lookup_/, '');
+    // IE doesn't like periods in the window name, so convert temporarily.
+    name = name.replace(/\./g, '___');
     var href;
     if (triggeringLink.href.search(/\?/) >= 0) {
         href = triggeringLink.href + '&pop=1';
 }
 
 function dismissRelatedLookupPopup(win, chosenId) {
-    var elem = document.getElementById(win.name);
+    var name = win.name.replace(/___/g, '.');
+    var elem = document.getElementById(name);
     if (elem.className.indexOf('vRawIdAdminField') != -1 && elem.value) {
         elem.value += ',' + chosenId;
     } else {
-        document.getElementById(win.name).value = chosenId;
+        document.getElementById(name).value = chosenId;
     }
     win.close();
 }

django/contrib/admin/templates/admin/base.html

         <div id="branding">
         {% block branding %}{% endblock %}
         </div>
-        {% if not user.is_anonymous %}
+        {% if not user.is_anonymous %}{% if user.is_staff %}
         <div id="user-tools">{% trans 'Welcome,' %} <strong>{% if user.first_name %}{{ user.first_name }}{% else %}{{ user.username }}{% endif %}</strong>. {% block userlinks %}<a href="doc/">{% trans 'Documentation' %}</a> / <a href="password_change/">{% trans 'Change password' %}</a> / <a href="logout/">{% trans 'Log out' %}</a>{% endblock %}</div>
-        {% endif %}
+        {% endif %}{% endif %}
         {% block nav-global %}{% endblock %}
     </div>
     <!-- END Header -->

django/contrib/admin/templatetags/admin_list.py

 from django.conf import settings
 from django.contrib.admin.views.main import MAX_SHOW_ALL_ALLOWED, ALL_VAR
 from django.contrib.admin.views.main import ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR
-from django.contrib.admin.views.main import IS_POPUP_VAR, EMPTY_CHANGELIST_VALUE, MONTHS
+from django.contrib.admin.views.main import IS_POPUP_VAR, EMPTY_CHANGELIST_VALUE
 from django.core.exceptions import ObjectDoesNotExist
 from django.db import models
 from django.utils import dateformat
 from django.utils.html import escape
 from django.utils.text import capfirst
-from django.utils.translation import get_date_formats
+from django.utils.translation import get_date_formats, get_partial_date_formats
 from django.template import Library
+import datetime
 
 register = Library()
 
         year_lookup = cl.params.get(year_field)
         month_lookup = cl.params.get(month_field)
         day_lookup = cl.params.get(day_field)
+        year_month_format, month_day_format = get_partial_date_formats()
 
         link = lambda d: cl.get_query_string(d, [field_generic])
 
         if year_lookup and month_lookup and day_lookup:
-            month_name = MONTHS[int(month_lookup)]
+            day = datetime.date(int(year_lookup), int(month_lookup), int(day_lookup))
             return {
                 'show': True,
                 'back': {
                     'link': link({year_field: year_lookup, month_field: month_lookup}),
-                    'title': "%s %s" % (month_name, year_lookup)
+                    'title': dateformat.format(day, year_month_format)
                 },
-                'choices': [{'title': "%s %s" % (month_name, day_lookup)}]
+                'choices': [{'title': dateformat.format(day, month_day_format)}]
             }
         elif year_lookup and month_lookup:
             days = cl.query_set.filter(**{year_field: year_lookup, month_field: month_lookup}).dates(field_name, 'day')
                 },
                 'choices': [{
                     'link': link({year_field: year_lookup, month_field: month_lookup, day_field: day.day}),
-                    'title': day.strftime('%B %d')
+                    'title': dateformat.format(day, month_day_format)
                 } for day in days]
             }
         elif year_lookup:
                 },
                 'choices': [{
                     'link': link({year_field: year_lookup, month_field: month.month}),
-                    'title': "%s %s" % (month.strftime('%B'), month.year)
+                    'title': dateformat.format(month, year_month_format)
                 } for month in months]
             }
         else:

django/contrib/admin/utils.py

 }
 
 def create_reference_role(rolename, urlbase):
-    def _role(name, rawtext, text, lineno, inliner, options={}, content=[]):
+    def _role(name, rawtext, text, lineno, inliner, options=None, content=None):
+        if options is None: options = {}
+        if content is None: content = []
         node = docutils.nodes.reference(rawtext, text, refuri=(urlbase % (inliner.document.settings.link_base, text.lower())), **options)
         return [node], []
     docutils.parsers.rst.roles.register_canonical_role(rolename, _role)
 
-def default_reference_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
+def default_reference_role(name, rawtext, text, lineno, inliner, options=None, content=None):
+    if options is None: options = {}
+    if content is None: content = []
     context = inliner.document.settings.default_reference_context
     node = docutils.nodes.reference(rawtext, text, refuri=(ROLES[context] % (inliner.document.settings.link_base, text.lower())), **options)
     return [node], []

django/contrib/admin/views/main.py

                     filter_specs.append(spec)
         return filter_specs, bool(filter_specs)
 
-    def get_query_string(self, new_params={}, remove=[]):
+    def get_query_string(self, new_params=None, remove=None):
+        if new_params is None: new_params = {}
+        if remove is None: remove = []
         p = self.params.copy()
         for r in remove:
             for k in p.keys():

django/contrib/auth/forms.py

         self.user_cache = authenticate(username=username, password=password)
         if self.user_cache is None:
             raise validators.ValidationError, _("Please enter a correct username and password. Note that both fields are case-sensitive.")
+        elif not self.user_cache.is_active:
+            raise validators.ValidationError, _("This account is inactive.")
 
     def get_user_id(self):
         if self.user_cache:

django/contrib/humanize/__init__.py

Empty file added.

django/contrib/humanize/templatetags/__init__.py

Empty file added.

django/contrib/humanize/templatetags/humanize.py

+from django import template
+import re
+
+register = template.Library()
+
+def ordinal(value):
+    """
+    Converts an integer to its ordinal as a string. 1 is '1st', 2 is '2nd',
+    3 is '3rd', etc. Works for any integer.
+    """
+    try:
+        value = int(value)
+    except ValueError:
+        return value
+    t = ('th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th')
+    if value % 100 in (11, 12, 13): # special case
+        return '%dth' % value
+    return '%d%s' % (value, t[value % 10])
+register.filter(ordinal)
+
+def intcomma(value):
+    """
+    Converts an integer to a string containing commas every three digits.
+    For example, 3000 becomes '3,000' and 45000 becomes '45,000'.
+    """
+    orig = str(value)
+    new = re.sub("^(-?\d+)(\d{3})", '\g<1>,\g<2>', str(value))
+    if orig == new:
+        return new
+    else:
+        return intcomma(new)
+register.filter(intcomma)
+
+def intword(value):
+    """
+    Converts a large integer to a friendly text representation. Works best for
+    numbers over 1 million. For example, 1000000 becomes '1.0 million', 1200000
+    becomes '1.2 million' and '1200000000' becomes '1.2 billion'.
+    """
+    value = int(value)
+    if value < 1000000:
+        return value
+    if value < 1000000000:
+        return '%.1f million' % (value / 1000000.0)
+    if value < 1000000000000:
+        return '%.1f billion' % (value / 1000000000.0)
+    if value < 1000000000000000:
+        return '%.1f trillion' % (value / 1000000000000.0)
+    return value
+register.filter(intword)
+
+def apnumber(value):
+    """
+    For numbers 1-9, returns the number spelled out. Otherwise, returns the
+    number. This follows Associated Press style.
+    """
+    try:
+        value = int(value)
+    except ValueError:
+        return value
+    if not 0 < value < 10:
+        return value
+    return ('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine')[value-1]
+register.filter(apnumber)

django/core/management.py

             # Don't bother loading IPython, because the user wants plain Python.
             raise ImportError
         import IPython
-        shell = IPython.Shell.IPShell()
+        # Explicitly pass an empty list as arguments, because otherwise IPython
+        # would use sys.argv from this script.
+        shell = IPython.Shell.IPShell(argv=[])
         shell.mainloop()
     except ImportError:
         import code
     sys.stderr.write(style.ERROR('Error: %s' % msg) + '\nRun "%s --help" for help.\n' % cmd)
     sys.exit(1)
 
-def execute_from_command_line(action_mapping=DEFAULT_ACTION_MAPPING):
+def execute_from_command_line(action_mapping=DEFAULT_ACTION_MAPPING, argv=None):
+    # Use sys.argv if we've not passed in a custom argv
+    if argv is None:
+        argv = sys.argv
+
     # Parse the command-line arguments. optparse handles the dirty work.
     parser = DjangoOptionParser(usage=get_usage(action_mapping), version=get_version())
     parser.add_option('--settings',
         help='Lets you manually add a directory the Python path, e.g. "/home/djangoprojects/myproject".')
     parser.add_option('--plain', action='store_true', dest='plain',
         help='Tells Django to use plain Python, not IPython, for "shell" command.')
-    options, args = parser.parse_args()
+    options, args = parser.parse_args(argv[1:])
 
     # Take care of options.
     if options.settings:
     except IndexError:
         parser.print_usage_and_exit()
     if not action_mapping.has_key(action):
-        print_error("Your action, %r, was invalid." % action, sys.argv[0])
+        print_error("Your action, %r, was invalid." % action, argv[0])
 
     # Switch to English, because django-admin.py creates database content
     # like permissions, and those shouldn't contain any translations.
         if action not in NO_SQL_TRANSACTION:
             print style.SQL_KEYWORD("COMMIT;")
 
-def execute_manager(settings_mod):
+def execute_manager(settings_mod, argv=None):
     # Add this project to sys.path so that it's importable in the conventional
     # way. For example, if this file (manage.py) lives in a directory
     # "myproject", this code would add "/path/to/myproject" to sys.path.
     action_mapping['startapp'].args = startapp.args
 
     # Run the django-admin.py command.
-    execute_from_command_line(action_mapping)
+    execute_from_command_line(action_mapping, argv)

django/core/urlresolvers.py

     dot = callback.rindex('.')
     return callback[:dot], callback[dot+1:]
 
+def reverse_helper(regex, *args, **kwargs):
+    """
+    Does a "reverse" lookup -- returns the URL for the given args/kwargs.
+    The args/kwargs are applied to the given compiled regular expression.
+    For example:
+
+        >>> reverse_helper(re.compile('^places/(\d+)/$'), 3)
+        'places/3/'
+        >>> reverse_helper(re.compile('^places/(?P<id>\d+)/$'), id=3)
+        'places/3/'
+        >>> reverse_helper(re.compile('^people/(?P<state>\w\w)/(\w+)/$'), 'adrian', state='il')
+        'people/il/adrian/'
+
+    Raises NoReverseMatch if the args/kwargs aren't valid for the regex.
+    """
+    # TODO: Handle nested parenthesis in the following regex.
+    result = re.sub(r'\(([^)]+)\)', MatchChecker(args, kwargs), regex.pattern)
+    return result.replace('^', '').replace('$', '')
+
 class MatchChecker(object):
     "Class used in reverse RegexURLPattern lookup."
     def __init__(self, args, kwargs):
         return self.reverse_helper(*args, **kwargs)
 
     def reverse_helper(self, *args, **kwargs):
-        """
-        Does a "reverse" lookup -- returns the URL for the given args/kwargs.
-        The args/kwargs are applied to the regular expression in this
-        RegexURLPattern. For example:
-
-            >>> RegexURLPattern('^places/(\d+)/$').reverse_helper(3)
-            'places/3/'
-            >>> RegexURLPattern('^places/(?P<id>\d+)/$').reverse_helper(id=3)
-            'places/3/'
-            >>> RegexURLPattern('^people/(?P<state>\w\w)/(\w+)/$').reverse_helper('adrian', state='il')
-            'people/il/adrian/'
-
-        Raises NoReverseMatch if the args/kwargs aren't valid for the RegexURLPattern.
-        """
-        # TODO: Handle nested parenthesis in the following regex.
-        result = re.sub(r'\(([^)]+)\)', MatchChecker(args, kwargs), self.regex.pattern)
-        return result.replace('^', '').replace('$', '')
+        return reverse_helper(self.regex, *args, **kwargs)
 
 class RegexURLResolver(object):
     def __init__(self, regex, urlconf_name):
 
     def reverse(self, viewname, *args, **kwargs):
         for pattern in self.urlconf_module.urlpatterns:
-            if pattern.callback == viewname:
+            if isinstance(pattern, RegexURLResolver):
+                try:
+                    return pattern.reverse_helper(viewname, *args, **kwargs)
+                except NoReverseMatch:
+                    continue
+            elif pattern.callback == viewname:
                 try:
                     return pattern.reverse_helper(*args, **kwargs)
                 except NoReverseMatch:
                     continue
         raise NoReverseMatch
+
+    def reverse_helper(self, viewname, *args, **kwargs):
+        sub_match = self.reverse(viewname, *args, **kwargs)
+        result = reverse_helper(self.regex, *args, **kwargs)
+        return result + sub_match

django/core/validators.py

     as a validation error. The message is rather unspecific, so it's best to
     specify one on instantiation.
     """
-    def __init__(self, validator_list=[], error_message=gettext_lazy("This field is invalid.")):
+    def __init__(self, validator_list=None, error_message=gettext_lazy("This field is invalid.")):
+        if validator_list is None: validator_list = []
         self.validator_list = validator_list
         self.error_message = error_message
         for v in validator_list:

django/db/backends/ado_mssql/base.py

 def get_random_function_sql():
     return "RAND()"
 
+def get_fulltext_search_sql(field_name):
+    raise NotImplementedError
+
 def get_drop_foreignkey_sql():
     return "DROP CONSTRAINT"
 

django/db/backends/dummy/base.py

 get_date_trunc_sql = complain
 get_limit_offset_sql = complain
 get_random_function_sql = complain
+get_fulltext_search_sql = complain
 get_drop_foreignkey_sql = complain
 OPERATOR_MAPPING = {}

django/db/backends/mysql/base.py

 def get_random_function_sql():
     return "RAND()"
 
+def get_fulltext_search_sql(field_name):
+    return 'MATCH (%s) AGAINST (%%s IN BOOLEAN MODE)' % field_name
+
 def get_drop_foreignkey_sql():
     return "DROP FOREIGN KEY"
 

django/db/backends/oracle/base.py

     This fixes it -- but note that if you want to use a literal "%s" in a query,
     you'll need to use "%%s".
     """
-    def execute(self, query, params=[]):
+    def execute(self, query, params=None):
+        if params is None: params = []
         query = self.convert_arguments(query, len(params))
         return Database.Cursor.execute(self, query, params)
 
-    def executemany(self, query, params=[]):
+    def executemany(self, query, params=None):
+        if params is None: params = []
         query = self.convert_arguments(query, len(params[0]))
         return Database.Cursor.executemany(self, query, params)
 
 def get_random_function_sql():
     return "DBMS_RANDOM.RANDOM"
 
+def get_fulltext_search_sql(field_name):
+    raise NotImplementedError
+
 def get_drop_foreignkey_sql():
     return "DROP FOREIGN KEY"
 

django/db/backends/postgresql/base.py

 def get_random_function_sql():
     return "RANDOM()"
 
+def get_fulltext_search_sql(field_name):
+    raise NotImplementedError
+
 def get_drop_foreignkey_sql():
     return "DROP CONSTRAINT"
 

django/db/backends/postgresql_psycopg2/base.py

 def get_random_function_sql():
     return "RANDOM()"
 
+def get_fulltext_search_sql(field_name):
+    raise NotImplementedError
+
 def get_drop_foreignkey_sql():
     return "DROP CONSTRAINT"
 

django/db/backends/sqlite3/base.py

 def get_random_function_sql():
     return "RANDOM()"
 
+def get_fulltext_search_sql(field_name):
+    raise NotImplementedError
+
 def get_drop_foreignkey_sql():
     return ""
 

django/db/models/fields/__init__.py

 
     def get_db_prep_lookup(self, lookup_type, value):
         "Returns field's value prepared for database lookup."
-        if lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte', 'ne', 'year', 'month', 'day'):
+        if lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte', 'ne', 'year', 'month', 'day', 'search'):
             return [value]
         elif lookup_type in ('range', 'in'):
             return value

django/db/models/fields/related.py

                             setattr(obj, rel_field.name, None)
                             obj.save()
                         else:
-                            raise rel_field.rel.to.DoesNotExist, "'%s' is not related to '%s'." % (obj, instance)
+                            raise rel_field.rel.to.DoesNotExist, "%r is not related to %r." % (obj, instance)
                 remove.alters_data = True
 
                 def clear(self):
         self.related_name = related_name
         self.filter_interface = filter_interface
         if limit_choices_to is None:
-            limit_choices_to = {}        
+            limit_choices_to = {}
         self.limit_choices_to = limit_choices_to
         self.edit_inline = False
         self.raw_id_admin = raw_id_admin

django/db/models/query.py

         return "%s = %%s" % backend.get_date_extract_sql(lookup_type, table_prefix + field_name)
     elif lookup_type == 'isnull':
         return "%s%s IS %sNULL" % (table_prefix, field_name, (not value and 'NOT ' or ''))
+    elif lookup_type == 'search':
+        return backend.get_fulltext_search_sql(table_prefix + field_name)
     raise TypeError, "Got invalid lookup_type: %s" % repr(lookup_type)
 
 def get_cached_row(klass, row, index_start):

django/forms/__init__.py

 
 class TextField(FormField):
     input_type = "text"
-    def __init__(self, field_name, length=30, maxlength=None, is_required=False, validator_list=[], member_name=None):
+    def __init__(self, field_name, length=30, maxlength=None, is_required=False, validator_list=None, member_name=None):
+        if validator_list is None: validator_list = []
         self.field_name = field_name
         self.length, self.maxlength = length, maxlength
         self.is_required = is_required
     input_type = "password"
 
 class LargeTextField(TextField):
-    def __init__(self, field_name, rows=10, cols=40, is_required=False, validator_list=[], maxlength=None):
+    def __init__(self, field_name, rows=10, cols=40, is_required=False, validator_list=None, maxlength=None):
+        if validator_list is None: validator_list = []
         self.field_name = field_name
         self.rows, self.cols, self.is_required = rows, cols, is_required
         self.validator_list = validator_list[:]
             self.field_name, self.rows, self.cols, escape(data))
 
 class HiddenField(FormField):
-    def __init__(self, field_name, is_required=False, validator_list=[]):
+    def __init__(self, field_name, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         self.field_name, self.is_required = field_name, is_required
         self.validator_list = validator_list[:]
 
     html2python = staticmethod(html2python)
 
 class SelectField(FormField):
-    def __init__(self, field_name, choices=[], size=1, is_required=False, validator_list=[], member_name=None):
+    def __init__(self, field_name, choices=None, size=1, is_required=False, validator_list=None, member_name=None):
+        if validator_list is None: validator_list = []
+        if choices is None: choices = []
         self.field_name = field_name
         # choices is a list of (value, human-readable key) tuples because order matters
         self.choices, self.size, self.is_required = choices, size, is_required
     html2python = staticmethod(html2python)
 
 class RadioSelectField(FormField):
-    def __init__(self, field_name, choices=[], ul_class='', is_required=False, validator_list=[], member_name=None):
+    def __init__(self, field_name, choices=None, ul_class='', is_required=False, validator_list=None, member_name=None):
+        if validator_list is None: validator_list = []
+        if choices is None: choices = []
         self.field_name = field_name
         # choices is a list of (value, human-readable key) tuples because order matters
         self.choices, self.is_required = choices, is_required
 
 class NullBooleanField(SelectField):
     "This SelectField provides 'Yes', 'No' and 'Unknown', mapping results to True, False or None"
-    def __init__(self, field_name, is_required=False, validator_list=[]):
+    def __init__(self, field_name, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         SelectField.__init__(self, field_name, choices=[('1', 'Unknown'), ('2', 'Yes'), ('3', 'No')],
             is_required=is_required, validator_list=validator_list)
 
     back into the single list that validators, renderers and save() expect.
     """
     requires_data_list = True
-    def __init__(self, field_name, choices=[], validator_list=[]):
+    def __init__(self, field_name, choices=None, validator_list=None):
+        if validator_list is None: validator_list = []
+        if choices is None: choices = []
         SelectMultipleField.__init__(self, field_name, choices, size=1, is_required=False, validator_list=validator_list)
 
     def prepare(self, new_data):
 ####################
 
 class FileUploadField(FormField):
-    def __init__(self, field_name, is_required=False, validator_list=[]):
+    def __init__(self, field_name, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         self.field_name, self.is_required = field_name, is_required
         self.validator_list = [self.isNonEmptyFile] + validator_list
 
 ####################
 
 class IntegerField(TextField):
-    def __init__(self, field_name, length=10, maxlength=None, is_required=False, validator_list=[], member_name=None):
+    def __init__(self, field_name, length=10, maxlength=None, is_required=False, validator_list=None, member_name=None):
+        if validator_list is None: validator_list = []
         validator_list = [self.isInteger] + validator_list
         if member_name is not None:
             self.member_name = member_name
     html2python = staticmethod(html2python)
 
 class SmallIntegerField(IntegerField):
-    def __init__(self, field_name, length=5, maxlength=5, is_required=False, validator_list=[]):
+    def __init__(self, field_name, length=5, maxlength=5, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         validator_list = [self.isSmallInteger] + validator_list
         IntegerField.__init__(self, field_name, length, maxlength, is_required, validator_list)
 
             raise validators.CriticalValidationError, gettext("Enter a whole number between -32,768 and 32,767.")
 
 class PositiveIntegerField(IntegerField):
-    def __init__(self, field_name, length=10, maxlength=None, is_required=False, validator_list=[]):
+    def __init__(self, field_name, length=10, maxlength=None, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         validator_list = [self.isPositive] + validator_list
         IntegerField.__init__(self, field_name, length, maxlength, is_required, validator_list)
 
             raise validators.CriticalValidationError, gettext("Enter a positive number.")
 
 class PositiveSmallIntegerField(IntegerField):
-    def __init__(self, field_name, length=5, maxlength=None, is_required=False, validator_list=[]):
+    def __init__(self, field_name, length=5, maxlength=None, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         validator_list = [self.isPositiveSmall] + validator_list
         IntegerField.__init__(self, field_name, length, maxlength, is_required, validator_list)
 
             raise validators.CriticalValidationError, gettext("Enter a whole number between 0 and 32,767.")
 
 class FloatField(TextField):
-    def __init__(self, field_name, max_digits, decimal_places, is_required=False, validator_list=[]):
+    def __init__(self, field_name, max_digits, decimal_places, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         self.max_digits, self.decimal_places = max_digits, decimal_places
         validator_list = [self.isValidFloat] + validator_list
         TextField.__init__(self, field_name, max_digits+1, max_digits+1, is_required, validator_list)
 class DatetimeField(TextField):
     """A FormField that automatically converts its data to a datetime.datetime object.
     The data should be in the format YYYY-MM-DD HH:MM:SS."""
-    def __init__(self, field_name, length=30, maxlength=None, is_required=False, validator_list=[]):
+    def __init__(self, field_name, length=30, maxlength=None, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         self.field_name = field_name
         self.length, self.maxlength = length, maxlength
         self.is_required = is_required
 class DateField(TextField):
     """A FormField that automatically converts its data to a datetime.date object.
     The data should be in the format YYYY-MM-DD."""
-    def __init__(self, field_name, is_required=False, validator_list=[]):
+    def __init__(self, field_name, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         validator_list = [self.isValidDate] + validator_list
         TextField.__init__(self, field_name, length=10, maxlength=10,
             is_required=is_required, validator_list=validator_list)
 class TimeField(TextField):
     """A FormField that automatically converts its data to a datetime.time object.
     The data should be in the format HH:MM:SS or HH:MM:SS.mmmmmm."""
-    def __init__(self, field_name, is_required=False, validator_list=[]):
+    def __init__(self, field_name, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         validator_list = [self.isValidTime] + validator_list
         TextField.__init__(self, field_name, length=8, maxlength=8,
             is_required=is_required, validator_list=validator_list)
 
 class EmailField(TextField):
     "A convenience FormField for validating e-mail addresses"
-    def __init__(self, field_name, length=50, maxlength=75, is_required=False, validator_list=[]):
+    def __init__(self, field_name, length=50, maxlength=75, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         validator_list = [self.isValidEmail] + validator_list
         TextField.__init__(self, field_name, length, maxlength=maxlength,
             is_required=is_required, validator_list=validator_list)
 
 class URLField(TextField):
     "A convenience FormField for validating URLs"
-    def __init__(self, field_name, length=50, maxlength=200, is_required=False, validator_list=[]):
+    def __init__(self, field_name, length=50, maxlength=200, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         validator_list = [self.isValidURL] + validator_list
         TextField.__init__(self, field_name, length=length, maxlength=maxlength,
             is_required=is_required, validator_list=validator_list)
             raise validators.CriticalValidationError, e.messages
 
 class IPAddressField(TextField):
-    def __init__(self, field_name, length=15, maxlength=15, is_required=False, validator_list=[]):
+    def __init__(self, field_name, length=15, maxlength=15, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         validator_list = [self.isValidIPAddress] + validator_list
         TextField.__init__(self, field_name, length=length, maxlength=maxlength,
             is_required=is_required, validator_list=validator_list)
 
 class FilePathField(SelectField):
     "A SelectField whose choices are the files in a given directory."
-    def __init__(self, field_name, path, match=None, recursive=False, is_required=False, validator_list=[]):
+    def __init__(self, field_name, path, match=None, recursive=False, is_required=False, validator_list=None):
         import os
         if match is not None:
             import re
 
 class PhoneNumberField(TextField):
     "A convenience FormField for validating phone numbers (e.g. '630-555-1234')"
-    def __init__(self, field_name, is_required=False, validator_list=[]):
+    def __init__(self, field_name, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         validator_list = [self.isValidPhone] + validator_list
         TextField.__init__(self, field_name, length=12, maxlength=12,
             is_required=is_required, validator_list=validator_list)
 
 class USStateField(TextField):
     "A convenience FormField for validating U.S. states (e.g. 'IL')"
-    def __init__(self, field_name, is_required=False, validator_list=[]):
+    def __init__(self, field_name, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         validator_list = [self.isValidUSState] + validator_list
         TextField.__init__(self, field_name, length=2, maxlength=2,
             is_required=is_required, validator_list=validator_list)
 
 class CommaSeparatedIntegerField(TextField):
     "A convenience FormField for validating comma-separated integer fields"
-    def __init__(self, field_name, maxlength=None, is_required=False, validator_list=[]):
+    def __init__(self, field_name, maxlength=None, is_required=False, validator_list=None):
+        if validator_list is None: validator_list = []
         validator_list = [self.isCommaSeparatedIntegerList] + validator_list
         TextField.__init__(self, field_name, length=20, maxlength=maxlength,
             is_required=is_required, validator_list=validator_list)

django/template/__init__.py

         for lib in builtins:
             self.add_library(lib)
 
-    def parse(self, parse_until=[]):
+    def parse(self, parse_until=None):
+        if parse_until is None: parse_until = []
         nodelist = self.create_nodelist()
         while self.tokens:
             token = self.next_token()

django/utils/datastructures.py

 
 class SortedDict(dict):
     "A dictionary that keeps its keys in the order in which they're inserted."
-    def __init__(self, data={}):
+    def __init__(self, data=None):
+        if data is None: data = {}
         dict.__init__(self, data)
         self.keyOrder = data.keys()
 
     def __copy__(self):
         return self.__class__(dict.items(self))
 
-    def __deepcopy__(self, memo={}):
+    def __deepcopy__(self, memo=None):
         import copy
+        if memo is None: memo = {}
         result = self.__class__()
         memo[id(self)] = result
         for key, value in dict.items(self):

django/utils/translation.py

     False = left-to-right layout
     True = right-to-left layout
     """
-    
+
     from django.conf import settings
     return get_language() in settings.LANGUAGES_BIDI
-    
+
 def catalog():
     """
     This function returns the current active catalog for further processing.
         datetime_format = settings.DATETIME_FORMAT
     if time_format == 'TIME_FORMAT':
         time_format = settings.TIME_FORMAT
-    return (date_format, datetime_format, time_format)
+    return date_format, datetime_format, time_format
+
+def get_partial_date_formats():
+    """
+    This function checks whether translation files provide a translation for some
+    technical message ID to store partial date formats. If it doesn't contain
+    one, the formats provided in the settings will be used.
+    """
+    from django.conf import settings
+    year_month_format = _('YEAR_MONTH_FORMAT')
+    month_day_format = _('MONTH_DAY_FORMAT')
+    if year_month_format == 'YEAR_MONTH_FORMAT':
+        year_month_format = settings.YEAR_MONTH_FORMAT
+    if month_day_format == 'MONTH_DAY_FORMAT':
+        month_day_format = settings.MONTH_DAY_FORMAT
+    return year_month_format, month_day_format
 
 def install():
     """

django/utils/xmlutils.py

 from xml.sax.saxutils import XMLGenerator
 
 class SimplerXMLGenerator(XMLGenerator):
-    def addQuickElement(self, name, contents=None, attrs={}):
+    def addQuickElement(self, name, contents=None, attrs=None):
         "Convenience method for adding an element with no children"
+        if attrs is None: attrs = {}
         self.startElement(name, attrs)
         if contents is not None:
             self.characters(contents)

django/views/generic/create_update.py

 from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured
 
 def create_object(request, model, template_name=None,
-        template_loader=loader, extra_context={}, post_save_redirect=None,
+        template_loader=loader, extra_context=None, post_save_redirect=None,
         login_required=False, follow=None, context_processors=None):
     """
     Generic object-creation function.
         form
             the form wrapper for the object
     """
+    if extra_context is None: extra_context = {}
     if login_required and request.user.is_anonymous():
         return redirect_to_login(request.path)
 
 
 def update_object(request, model, object_id=None, slug=None,
         slug_field=None, template_name=None, template_loader=loader,
-        extra_context={}, post_save_redirect=None,
+        extra_context=None, post_save_redirect=None,
         login_required=False, follow=None, context_processors=None,
         template_object_name='object'):
     """
         object
             the original object being edited
     """
+    if extra_context is None: extra_context = {}
     if login_required and request.user.is_anonymous():
         return redirect_to_login(request.path)
 
 
 def delete_object(request, model, post_delete_redirect,
         object_id=None, slug=None, slug_field=None, template_name=None,
-        template_loader=loader, extra_context={},
+        template_loader=loader, extra_context=None,
         login_required=False, context_processors=None, template_object_name='object'):
     """
     Generic object-delete function.
         object
             the original object being deleted
     """
+    if extra_context is None: extra_context = {}
     if login_required and request.user.is_anonymous():
         return redirect_to_login(request.path)
 

django/views/generic/date_based.py

 
 def archive_index(request, queryset, date_field, num_latest=15,
         template_name=None, template_loader=loader,
-        extra_context={}, allow_empty=False, context_processors=None,
+        extra_context=None, allow_empty=False, context_processors=None,
         mimetype=None):
     """
     Generic top-level archive of date-based objects.
         latest
             Latest N (defaults to 15) objects by date
     """
+    if extra_context is None: extra_context = {}
     model = queryset.model
     queryset = queryset.filter(**{'%s__lte' % date_field: datetime.datetime.now()})
     date_list = queryset.dates(date_field, 'year')[::-1]
     return HttpResponse(t.render(c), mimetype=mimetype)
 
 def archive_year(request, year, queryset, date_field, template_name=None,
-        template_loader=loader, extra_context={}, allow_empty=False,
+        template_loader=loader, extra_context=None, allow_empty=False,
         context_processors=None, template_object_name='object', mimetype=None,
         make_object_list=False):
     """
             List of objects published in the given month
             (Only available if make_object_list argument is True)
     """
+    if extra_context is None: extra_context = {}
     model = queryset.model
     now = datetime.datetime.now()
 
 
 def archive_month(request, year, month, queryset, date_field,
         month_format='%b', template_name=None, template_loader=loader,
-        extra_context={}, allow_empty=False, context_processors=None,
+        extra_context=None, allow_empty=False, context_processors=None,
         template_object_name='object', mimetype=None):
     """
     Generic monthly archive view.
         object_list:
             list of objects published in the given month
     """
+    if extra_context is None: extra_context = {}
     try:
         date = datetime.date(*time.strptime(year+month, '%Y'+month_format)[:3])
     except ValueError:
 
 def archive_week(request, year, week, queryset, date_field,
         template_name=None, template_loader=loader,
-        extra_context={}, allow_empty=True, context_processors=None,
+        extra_context=None, allow_empty=True, context_processors=None,
         template_object_name='object', mimetype=None):
     """
     Generic weekly archive view.
         object_list:
             list of objects published in the given week
     """
+    if extra_context is None: extra_context = {}
     try:
         date = datetime.date(*time.strptime(year+'-0-'+week, '%Y-%w-%U')[:3])
     except ValueError:
 
 def archive_day(request, year, month, day, queryset, date_field,
         month_format='%b', day_format='%d', template_name=None,
-        template_loader=loader, extra_context={}, allow_empty=False,
+        template_loader=loader, extra_context=None, allow_empty=False,
         context_processors=None, template_object_name='object',
         mimetype=None):
     """
         next_day
             (datetime) the next day, or None if the current day is today
     """
+    if extra_context is None: extra_context = {}
     try:
         date = datetime.date(*time.strptime(year+month+day, '%Y'+month_format+day_format)[:3])
     except ValueError:
 def object_detail(request, year, month, day, queryset, date_field,
         month_format='%b', day_format='%d', object_id=None, slug=None,
         slug_field=None, template_name=None, template_name_field=None,
-        template_loader=loader, extra_context={}, context_processors=None,
+        template_loader=loader, extra_context=None, context_processors=None,
         template_object_name='object', mimetype=None):
     """
     Generic detail view from year/month/day/slug or year/month/day/id structure.
         object:
             the object to be detailed
     """
+    if extra_context is None: extra_context = {}
     try:
         date = datetime.date(*time.strptime(year+month+day, '%Y'+month_format+day_format)[:3])
     except ValueError:

django/views/generic/list_detail.py

 from django.core.paginator import ObjectPaginator, InvalidPage
 from django.core.exceptions import ObjectDoesNotExist
 
-def object_list(request, queryset, paginate_by=None, allow_empty=False,
-        template_name=None, template_loader=loader,
-        extra_context={}, context_processors=None, template_object_name='object',
+def object_list(request, queryset, paginate_by=None, page=None,
+        allow_empty=False, template_name=None, template_loader=loader,
+        extra_context=None, context_processors=None, template_object_name='object',
         mimetype=None):
     """
     Generic list of objects.
         hits
             number of objects, total
     """
+    if extra_context is None: extra_context = {}
     queryset = queryset._clone()
     if paginate_by:
         paginator = ObjectPaginator(queryset, paginate_by)
-        page = request.GET.get('page', 1)
+        if not page:
+            page = request.GET.get('page', 1)
         try:
             page = int(page)
             object_list = paginator.get_page(page - 1)
 
 def object_detail(request, queryset, object_id=None, slug=None,
         slug_field=None, template_name=None, template_name_field=None,
-        template_loader=loader, extra_context={},
+        template_loader=loader, extra_context=None,
         context_processors=None, template_object_name='object',
         mimetype=None):
     """
         object
             the object
     """
+    if extra_context is None: extra_context = {}
     model = queryset.model
     if object_id:
         queryset = queryset.filter(pk=object_id)
 
 .. _csrf documentation: http://www.djangoproject.com/documentation/csrf/
 
+humanize
+========
+
+A set of Django template filters useful for adding a "human touch" to data.
+To activate these filters, add ``'django.contrib.english'`` to your
+``INSTALLED_APPS`` setting. Once you've done that, use ``{% load english %}``
+in a template, and you'll have access to these filters:
+
+apnumber
+--------
+
+For numbers 1-9, returns the number spelled out. Otherwise, returns the
+number. This follows Associated Press style.
+
+Examples:
+
+    * ``1`` becomes ``'one'``.
+    * ``2`` becomes ``'two'``.
+    * ``10`` becomes ``10``.
+
+You can pass in either an integer or a string representation of an integer.
+
+intcomma
+--------
+
+Converts an integer to a string containing commas every three digits.
+
+Examples:
+
+    * ``4500`` becomes ``'4,500'``.
+    * ``45000`` becomes ``'45,000'``.
+    * ``450000`` becomes ``'450,000'``.
+    * ``4500000`` becomes ``'4,500,000'``.
+
+You can pass in either an integer or a string representation of an integer.
+
+intword
+-------
+
+Converts a large integer to a friendly text representation. Works best for
+numbers over 1 million.
+
+Examples:
+
+    * ``1000000`` becomes ``'1.0 million'``.
+    * ``1200000`` becomes ``'1.2 million'``.
+    * ``1200000000`` becomes ``'1.2 billion'``.
+
+Values up to 1000000000000000 (one quadrillion) are supported.
+
+You can pass in either an integer or a string representation of an integer.
+
+ordinal
+-------
+
+Converts an integer to its ordinal as a string.
+
+Examples:
+
+    * ``1`` becomes ``'1st'``.
+    * ``2`` becomes ``'2nd'``.
+    * ``3`` becomes ``'3rd'``.
+
+You can pass in either an integer or a string representation of an integer.
+
 flatpages
 =========
 

docs/authentication.txt

 ``user_permissions``. ``User`` objects can access their related
 objects in the same way as any other `Django model`_::
 
-    ``myuser.objects.groups = [group_list]``
-    ``myuser.objects.groups.add(group, group,...)``
-    ``myuser.objects.groups.remove(group, group,...)``
-    ``myuser.objects.groups.clear()``
-    ``myuser.objects.permissions = [permission_list]``
-    ``myuser.objects.permissions.add(permission, permission, ...)``
-    ``myuser.objects.permissions.remove(permission, permission, ...]``
-    ``myuser.objects.permissions.clear()``
+    myuser.objects.groups = [group_list]
+    myuser.objects.groups.add(group, group,...)
+    myuser.objects.groups.remove(group, group,...)
+    myuser.objects.groups.clear()
+    myuser.objects.permissions = [permission_list]
+    myuser.objects.permissions.add(permission, permission, ...)
+    myuser.objects.permissions.remove(permission, permission, ...]
+    myuser.objects.permissions.clear()
 
 In addition to those automatic API methods, ``User`` objects have the following
 custom methods:
 
     SELECT ... WHERE pub_date IS NULL;
 
+search
+~~~~~~
+
+A boolean full-text search, taking advantage of full-text indexing. This is
+like ``contains`` but is significantly faster due to full-text indexing.
+
+Note this is only available in MySQL and requires direct manipulation of the
+database to add the full-text index.
+
 Default lookups are exact
 ~~~~~~~~~~~~~~~~~~~~~~~~~
 
 For every ``ImageField``, the object will have ``get_FOO_height()`` and
 ``get_FOO_width()`` methods, where ``FOO`` is the name of the field. This
 returns the height (or width) of the image, as an integer, in pixels.
+
+Falling back to raw SQL
+=======================
+
+If you find yourself needing to write an SQL query that is too complex for
+Django's database-mapper to handle, you can fall back into raw-SQL statement
+mode.
+
+The preferred way to do this is by giving your model custom methods or custom
+manager methods that execute queries. Although there's nothing in Django that
+*requires* database queries to live in the model layer, this approach keeps all
+your data-access logic in one place, which is smart from an code-organization
+standpoint. For instructions, see `Executing custom SQL`_.
+
+Finally, it's important to note that the Django database layer is merely an
+interface to your database. You can access your database via other tools,
+programming languages or database frameworks; there's nothing Django-specific
+about your database.
+
+.. _Executing custom SQL: http://www.djangoproject.com/documentation/model_api/#executing-custom-sql

docs/django-admin.txt

 might not have access to start a port on a low port number. Low port numbers
 are reserved for the superuser (root).
 
-DO NOT USE THIS SERVER IN A PRODUCTION SETTING.
+DO NOT USE THIS SERVER IN A PRODUCTION SETTING. It has not gone through
+security audits or performance tests. (And that's how it's gonna stay. We're in
+the business of making Web frameworks, not Web servers, so improving this
+server to be able to handle a production environment is outside the scope of
+Django.)
 
 The development server automatically reloads Python code for each request, as
 needed. You don't need to restart the server for code changes to take effect.
 .. _`Simon Willison`: http://simon.incutio.com/
 .. _`simon.incutio.com`: http://simon.incutio.com/
 .. _`Jacob Kaplan-Moss`: http://www.jacobian.org/
-.. _`Wilson Miner`: http://www.wilsonminer.com/live/
+.. _`Wilson Miner`: http://www.wilsonminer.com/
 
 Which sites use Django?
 -----------------------

docs/generic_views.txt

 
     * ``paginate_by``: An integer specifying how many objects should be
       displayed per page. If this is given, the view will paginate objects with
-      ``paginate_by`` objects per page. The view will expect a ``page`` query
-      string (GET) parameter containing a zero-indexed page number.
+      ``paginate_by`` objects per page. The view will expect either a ``page``
+      query string parameter (via ``GET``) containing a zero-indexed page
+      number, or a ``page`` variable specified in the URLconf. See
+      "Notes on pagination" below.
 
     * ``template_name``: The full name of a template to use in rendering the
       page. This lets you override the default template name (see below).
     * ``hits``: The total number of objects across *all* pages, not just this
       page.
 
+Notes on pagination
+~~~~~~~~~~~~~~~~~~~
+
+If ``paginate_by`` is specified, Django will paginate the results. You can
+specify the page number in the URL in one of two ways:
+
+    * Use the ``page`` parameter in the URLconf. For example, this is what
+      your URLconf might look like::
+
+        (r'^objects/page(?P<page>[0-9]+)/$', 'object_list', dict(info_dict))
+
+    * Pass the page number via the ``page`` query-string parameter. For
+      example, a URL would look like this:
+
+        /objects/?page=3
+
+In both cases, ``page`` is 1-based, not 0-based, so the first page would be
+represented as page ``1``.
+
 ``django.views.generic.list_detail.object_detail``
 --------------------------------------------------
 

docs/model-api.txt

 
 (This example also has ``search_fields`` defined. See below.)
 
+``list_per_page``
+-----------------
+
+Set ``list_per_page`` to control how many items appear on each paginated admin
+change list page. By default, this is set to ``100``.
+
 ``list_select_related``
 -----------------------
 

docs/settings.txt

 pages -- and, possibly, by other parts of the system. See
 `allowed date format strings`_.
 
-See also DATETIME_FORMAT and TIME_FORMAT.
+See also DATETIME_FORMAT, TIME_FORMAT, YEAR_MONTH_FORMAT and MONTH_DAY_FORMAT.
 
 .. _allowed date format strings: http://www.djangoproject.com/documentation/templates/#now
 
 pages -- and, possibly, by other parts of the system. See
 `allowed date format strings`_.
 
-See also DATE_FORMAT and TIME_FORMAT.
+See also DATE_FORMAT, DATETIME_FORMAT, TIME_FORMAT, YEAR_MONTH_FORMAT and MONTH_DAY_FORMAT.
 
 .. _allowed date format strings: http://www.djangoproject.com/documentation/templates/#now
 
 
 A tuple of middleware classes to use. See the `middleware docs`_.
 
+MONTH_DAY_FORMAT
+----------------
+
+Default: ``'F j'``
+
+The default formatting to use for date fields on Django admin change-list
+pages -- and, possibly, by other parts of the system -- in cases when only the
+month and day are displayed.
+
+For example, when a Django admin change-list page is being filtered by a date
+drilldown, the header for a given day displays the day and month. Different
+locales have different formats. For example, U.S. English would say
+"January 1," whereas Spanish might say "1 Enero."
+
+See `allowed date format strings`_. See also DATE_FORMAT, DATETIME_FORMAT,
+TIME_FORMAT and YEAR_MONTH_FORMAT.
+
 PREPEND_WWW
 -----------
 
 pages -- and, possibly, by other parts of the system. See
 `allowed date format strings`_.
 
-See also DATE_FORMAT and DATETIME_FORMAT.
+See also DATE_FORMAT, DATETIME_FORMAT, TIME_FORMAT, YEAR_MONTH_FORMAT and
+MONTH_DAY_FORMAT.
 
 .. _allowed date format strings: http://www.djangoproject.com/documentation/templates/#now
 
 bandwidth but slows down performance. This is only used if ``CommonMiddleware``
 is installed (see the `middleware docs`_).
 
+YEAR_MONTH_FORMAT
+-----------------
+
+Default: ``'F Y'``
+
+The default formatting to use for date fields on Django admin change-list
+pages -- and, possibly, by other parts of the system -- in cases when only the