Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

newforms-admin: Merged from trunk up to [5625]. This includes the Uni…

…code

merge, however, not all of admin/ (and none of admindocs/) has been ported and
checked yet.


git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@5627 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1e747f98af99a23c5aff7b460d5b845c3a9e2013 1 parent 7ed1a91
Malcolm Tredinnick authored July 07, 2007

Showing 205 changed files with 7,793 additions and 4,596 deletions. Show diff stats Hide diff stats

  1. 10  AUTHORS
  2. 2  django/bin/make-messages.py
  3. 4  django/conf/global_settings.py
  4. BIN  django/conf/locale/ca/LC_MESSAGES/django.mo
  5. 8  django/conf/locale/ca/LC_MESSAGES/django.po
  6. BIN  django/conf/locale/es/LC_MESSAGES/django.mo
  7. 3,684  django/conf/locale/es/LC_MESSAGES/django.po
  8. BIN  django/conf/locale/sl/LC_MESSAGES/django.mo
  9. 3,932  django/conf/locale/sl/LC_MESSAGES/django.po
  10. BIN  django/conf/locale/sl/LC_MESSAGES/djangojs.mo
  11. 67  django/conf/locale/sl/LC_MESSAGES/djangojs.po
  12. 14  django/contrib/admin/filterspecs.py
  13. 101  django/contrib/admin/media/js/urlify.js
  14. 9  django/contrib/admin/models.py
  15. 22  django/contrib/admin/options.py
  16. 6  django/contrib/admin/sites.py
  17. 2  django/contrib/admin/templates/admin/filter.html
  18. 33  django/contrib/admin/templatetags/admin_list.py
  19. 7  django/contrib/admin/templatetags/admin_modify.py
  20. 1  django/contrib/admin/views/auth.py
  21. 4  django/contrib/admin/views/decorators.py
  22. 44  django/contrib/admin/views/main.py
  23. 1  django/contrib/admin/widgets.py
  24. 2  django/contrib/auth/forms.py
  25. 4  django/contrib/auth/management.py
  26. 35  django/contrib/auth/models.py
  27. 1  django/contrib/auth/views.py
  28. 4  django/contrib/comments/feeds.py
  29. 2  django/contrib/comments/models.py
  30. 9  django/contrib/comments/views/comments.py
  31. 1  django/contrib/comments/views/karma.py
  32. 4  django/contrib/contenttypes/generic.py
  33. 3  django/contrib/contenttypes/management.py
  34. 13  django/contrib/contenttypes/models.py
  35. 32  django/contrib/databrowse/datastructures.py
  36. 9  django/contrib/databrowse/plugins/calendars.py
  37. 12  django/contrib/databrowse/plugins/fieldchoices.py
  38. 2  django/contrib/databrowse/sites.py
  39. 2  django/contrib/databrowse/templates/databrowse/fieldchoice_list.html
  40. 6  django/contrib/flatpages/models.py
  41. 18  django/contrib/humanize/templatetags/humanize.py
  42. 12  django/contrib/localflavor/au/forms.py
  43. 20  django/contrib/localflavor/br/forms.py
  44. 2  django/contrib/localflavor/ch/ch_states.py
  45. 6  django/contrib/localflavor/ch/forms.py
  46. 15  django/contrib/localflavor/cl/forms.py
  47. 2  django/contrib/localflavor/de/de_states.py
  48. 12  django/contrib/localflavor/de/forms.py
  49. 12  django/contrib/localflavor/fi/forms.py
  50. 8  django/contrib/localflavor/fr/forms.py
  51. 9  django/contrib/localflavor/is_/forms.py
  52. 14  django/contrib/localflavor/it/forms.py
  53. 2  django/contrib/localflavor/it/it_province.py
  54. 26  django/contrib/localflavor/it/util.py
  55. 6  django/contrib/localflavor/jp/forms.py
  56. 96  django/contrib/localflavor/jp/jp_prefectures.py
  57. 12  django/contrib/localflavor/no/forms.py
  58. 10  django/contrib/localflavor/no/no_municipalities.py
  59. 4  django/contrib/localflavor/uk/forms.py
  60. 20  django/contrib/localflavor/us/forms.py
  61. 15  django/contrib/markup/templatetags/markup.py
  62. 5  django/contrib/redirects/models.py
  63. 2  django/contrib/sessions/models.py
  64. 3  django/contrib/sitemaps/views.py
  65. 4  django/contrib/sites/models.py
  66. 13  django/contrib/syndication/feeds.py
  67. 46  django/contrib/webdesign/lorem_ipsum.py
  68. 2  django/contrib/webdesign/templatetags/webdesign.py
  69. 4  django/contrib/webdesign/tests.py
  70. 6  django/core/handlers/modpython.py
  71. 10  django/core/handlers/wsgi.py
  72. 43  django/core/mail.py
  73. 6  django/core/management.py
  74. 16  django/core/serializers/__init__.py
  75. 5  django/core/serializers/base.py
  76. 49  django/core/serializers/python.py
  77. 4  django/core/serializers/pyyaml.py
  78. 82  django/core/serializers/xml_serializer.py
  79. 27  django/core/urlresolvers.py
  80. 119  django/core/validators.py
  81. 2  django/db/backends/mysql/base.py
  82. 18  django/db/backends/mysql_old/base.py
  83. 64  django/db/backends/oracle/base.py
  84. 10  django/db/backends/oracle/creation.py
  85. 50  django/db/backends/postgresql/base.py
  86. 4  django/db/backends/postgresql_psycopg2/base.py
  87. 19  django/db/backends/sqlite3/base.py
  88. 19  django/db/backends/util.py
  89. 9  django/db/models/base.py
  90. 55  django/db/models/fields/__init__.py
  91. 7  django/db/models/fields/related.py
  92. 6  django/db/models/manipulators.py
  93. 22  django/db/models/options.py
  94. 3  django/db/models/query.py
  95. 98  django/http/__init__.py
  96. 72  django/newforms/fields.py
  97. 16  django/newforms/forms.py
  98. 14  django/newforms/models.py
  99. 18  django/newforms/util.py
  100. 40  django/newforms/widgets.py
  101. 172  django/oldforms/__init__.py
  102. 41  django/template/__init__.py
  103. 139  django/template/defaultfilters.py
  104. 7  django/template/defaulttags.py
  105. 2  django/template/loaders/app_directories.py
  106. 2  django/template/loaders/eggs.py
  107. 2  django/template/loaders/filesystem.py
  108. 8  django/templatetags/i18n.py
  109. 33  django/test/client.py
  110. 14  django/test/testcases.py
  111. 4  django/test/utils.py
  112. 3  django/utils/cache.py
  113. 54  django/utils/dateformat.py
  114. 6  django/utils/dates.py
  115. 25  django/utils/decorators.py
  116. 84  django/utils/encoding.py
  117. 50  django/utils/feedgenerator.py
  118. 55  django/utils/functional.py
  119. 41  django/utils/html.py
  120. 35  django/utils/http.py
  121. 2  django/utils/stopwords.py
  122. 54  django/utils/text.py
  123. 20  django/utils/timesince.py
  124. 23  django/utils/translation/__init__.py
  125. 11  django/utils/translation/trans_null.py
  126. 95  django/utils/translation/trans_real.py
  127. 13  django/utils/tzinfo.py
  128. 14  django/views/debug.py
  129. 8  django/views/generic/create_update.py
  130. 45  docs/contributing.txt
  131. 6  docs/db-api.txt
  132. 2  docs/forms.txt
  133. 176  docs/i18n.txt
  134. 50  docs/model-api.txt
  135. 2  docs/newforms.txt
  136. 4  docs/overview.txt
  137. 19  docs/settings.txt
  138. 10  docs/templates.txt
  139. 5  docs/templates_python.txt
  140. 31  docs/tutorial01.txt
  141. 364  docs/unicode.txt
  142. 11  tests/modeltests/basic/models.py
  143. 6  tests/modeltests/choices/models.py
  144. 18  tests/modeltests/custom_columns/models.py
  145. 8  tests/modeltests/custom_managers/models.py
  146. 2  tests/modeltests/custom_methods/models.py
  147. 10  tests/modeltests/custom_pk/models.py
  148. 2  tests/modeltests/field_defaults/models.py
  149. 20  tests/modeltests/fixtures/models.py
  150. 16  tests/modeltests/generic_relations/models.py
  151. 4  tests/modeltests/get_latest/models.py
  152. 4  tests/modeltests/get_object_or_404/models.py
  153. 4  tests/modeltests/get_or_create/models.py
  154. 32  tests/modeltests/lookup/models.py
  155. 4  tests/modeltests/m2m_and_m2o/models.py
  156. 10  tests/modeltests/m2m_intermediary/models.py
  157. 4  tests/modeltests/m2m_multiple/models.py
  158. 2  tests/modeltests/m2m_recursive/models.py
  159. 2  tests/modeltests/m2o_recursive/models.py
  160. 2  tests/modeltests/m2o_recursive2/models.py
  161. 16  tests/modeltests/manipulators/models.py
  162. 4  tests/modeltests/many_to_many/models.py
  163. 15  tests/modeltests/many_to_one/models.py
  164. 4  tests/modeltests/many_to_one_null/models.py
  165. 16  tests/modeltests/model_forms/models.py
  166. 12  tests/modeltests/model_inheritance/models.py
  167. 12  tests/modeltests/one_to_one/models.py
  168. 4  tests/modeltests/or_lookups/models.py
  169. 2  tests/modeltests/ordering/models.py
  170. 2  tests/modeltests/pagination/models.py
  171. 2  tests/modeltests/reserved_names/models.py
  172. 6  tests/modeltests/reverse_lookup/models.py
  173. 4  tests/modeltests/save_delete_hooks/models.py
  174. 16  tests/modeltests/select_related/models.py
  175. 10  tests/modeltests/serializers/models.py
  176. 36  tests/modeltests/str/models.py
  177. 10  tests/modeltests/test_client/models.py
  178. 2  tests/modeltests/test_client/views.py
  179. 6  tests/modeltests/transactions/models.py
  180. 14  tests/modeltests/validation/models.py
  181. 46  tests/regressiontests/dateformat/tests.py
  182. 446  tests/regressiontests/defaultfilters/tests.py
  183. 6  tests/regressiontests/fixtures_regress/models.py
  184. 14  tests/regressiontests/forms/localflavor.py
  185. 49  tests/regressiontests/forms/regressions.py
  186. 2  tests/regressiontests/forms/tests.py
  187. 76  tests/regressiontests/httpwrappers/tests.py
  188. 10  tests/regressiontests/humanize/tests.py
  189. 0  tests/regressiontests/i18n/__init__.py
  190. 0  tests/regressiontests/i18n/models.py
  191. 33  tests/regressiontests/i18n/tests.py
  192. 0  tests/regressiontests/model_regress/__init__.py
  193. 34  tests/regressiontests/model_regress/models.py
  194. 8  tests/regressiontests/null_queries/models.py
  195. 12  tests/regressiontests/one_to_one_regress/models.py
  196. 3  tests/regressiontests/serializers_regress/tests.py
  197. 38  tests/regressiontests/string_lookup/models.py
  198. 21  tests/regressiontests/templates/tests.py
  199. 33  tests/regressiontests/templates/unicode.py
  200. 2  tests/regressiontests/templates/urls.py
  201. 18  tests/regressiontests/test_client_regress/models.py
  202. 2  tests/regressiontests/test_client_regress/urls.py
  203. 14  tests/regressiontests/test_client_regress/views.py
  204. 31  tests/regressiontests/text/tests.py
  205. 1  tests/runtests.py
10  AUTHORS
@@ -44,6 +44,7 @@ answer newbie questions, and generally made Django that much better:
44 44
     alang@bright-green.com
45 45
     Marty Alchin <gulopine@gamemusic.org>
46 46
     Daniel Alves Barbosa de Oliveira Vaz <danielvaz@gmail.com>
  47
+    AgarFu <heaven@croasanaso.sytes.net>
47 48
     Andreas
48 49
     andy@jadedplanet.net
49 50
     Fabrice Aneche <akh@nobugware.com>
@@ -60,9 +61,11 @@ answer newbie questions, and generally made Django that much better:
60 61
     Ben <afternoon@uk2.net>
61 62
     Paul Bissex <http://e-scribe.com/>
62 63
     Simon Blanchard
  64
+    boobsd@gmail.com
63 65
     Andrew Brehaut <http://brehaut.net/blog>
64 66
     brut.alll@gmail.com
65 67
     Jonathan Buchanan <jonathan.buchanan@gmail.com>
  68
+    Ricardo Javier Cárdenes Medina <ricardo.cardenes@gmail.com>
66 69
     Antonio Cavedoni <http://cavedoni.com/>
67 70
     C8E
68 71
     Chris Chamberlin <dja@cdc.msbx.net>
@@ -106,13 +109,16 @@ answer newbie questions, and generally made Django that much better:
106 109
     Eric Floehr <eric@intellovations.com>
107 110
     Jorge Gajon <gajon@gajon.org>
108 111
     gandalf@owca.info
  112
+    Marc Garcia <marc.garcia@accopensys.com>
109 113
     Baishampayan Ghose
110 114
     glin@seznam.cz
111 115
     martin.glueck@gmail.com
112 116
     GomoX <gomo@datafull.com>
  117
+    Mario Gonzalez <gonzalemario @t gmail.com>
113 118
     Simon Greenhill <dev@simon.net.nz>
114 119
     Owen Griffiths
115 120
     Espen Grindhaug <http://grindhaug.org/>
  121
+    Thomas Güttler <hv@tbz-pariv.de>
116 122
     Brian Harring <ferringb@gmail.com>
117 123
     Brant Harris
118 124
     Hawkeye
@@ -141,12 +147,15 @@ answer newbie questions, and generally made Django that much better:
141 147
     Sune Kirkeby <http://ibofobi.dk/>
142 148
     Bastian Kleineidam <calvin@debian.org>
143 149
     Cameron Knight (ckknight)
  150
+    Nena Kojadin <nena@kiberpipa.org>
  151
+    Igor Kolar <ike@email.si>
144 152
     Gasper Koren
145 153
     Martin Kosír <martin@martinkosir.net>
146 154
     Meir Kriheli <http://mksoft.co.il/>
147 155
     Bruce Kroeze <http://coderseye.com/>
148 156
     Joseph Kocherhans
149 157
     konrad@gwu.edu
  158
+    kurtiss@meetro.com
150 159
     lakin.wecker@gmail.com
151 160
     Nick Lane <nick.lane.au@gmail.com>
152 161
     Stuart Langridge <http://www.kryogenix.org/>
@@ -214,6 +223,7 @@ answer newbie questions, and generally made Django that much better:
214 223
     scott@staplefish.com
215 224
     serbaut@gmail.com
216 225
     Pete Shinners <pete@shinners.org>
  226
+    Jozko Skrablin <jozko.skrablin@gmail.com>
217 227
     SmileyChris <smileychris@gmail.com>
218 228
     smurf@smurf.noris.de
219 229
     sopel
2  django/bin/make-messages.py
@@ -103,7 +103,7 @@ def make_messages():
103 103
                         open(os.path.join(dirpath, '%s.py' % file), "wb").write(templatize(src))
104 104
                         thefile = '%s.py' % file
105 105
                     if verbose: sys.stdout.write('processing file %s in %s\n' % (file, dirpath))
106  
-                    cmd = 'xgettext %s -d %s -L Python --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % (
  106
+                    cmd = 'xgettext %s -d %s -L Python --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --keyword=ugettext_noop --keyword=ugettext_lazy --keyword=ungettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % (
107 107
                         os.path.exists(potfile) and '--omit-header' or '', domain, os.path.join(dirpath, thefile))
108 108
                     (stdin, stdout, stderr) = os.popen3(cmd, 'b')
109 109
                     msgs = stdout.read()
4  django/conf/global_settings.py
@@ -97,6 +97,9 @@
97 97
 DEFAULT_CONTENT_TYPE = 'text/html'
98 98
 DEFAULT_CHARSET = 'utf-8'
99 99
 
  100
+# Encoding of files read from disk (template and initial SQL files).
  101
+FILE_CHARSET = 'utf-8'
  102
+
100 103
 # E-mail address that error messages come from.
101 104
 SERVER_EMAIL = 'root@localhost'
102 105
 
@@ -280,6 +283,7 @@
280 283
 # possible values.
281 284
 CACHE_BACKEND = 'simple://'
282 285
 CACHE_MIDDLEWARE_KEY_PREFIX = ''
  286
+CACHE_MIDDLEWARE_SECONDS = 600
283 287
 
284 288
 ####################
285 289
 # COMMENTS         #
BIN  django/conf/locale/ca/LC_MESSAGES/django.mo
Binary file not shown
8  django/conf/locale/ca/LC_MESSAGES/django.po
@@ -237,7 +237,7 @@ msgstr "Coreà"
237 237
 
238 238
 #: conf/global_settings.py:61
239 239
 msgid "Kannada"
240  
-msgstr ""
  240
+msgstr "Canès"
241 241
 
242 242
 #: conf/global_settings.py:62
243 243
 msgid "Latvian"
@@ -1230,7 +1230,7 @@ msgstr "Pot editar-lo de nou abaix."
1230 1230
 
1231 1231
 #: contrib/admin/views/auth.py:30
1232 1232
 msgid "Add user"
1233  
-msgstr "Agregar usuari"
  1233
+msgstr "Afegir usuari"
1234 1234
 
1235 1235
 #: contrib/admin/views/auth.py:57
1236 1236
 msgid "Password changed successfully."
@@ -1248,12 +1248,12 @@ msgstr "Lloc administratiu"
1248 1248
 #: contrib/admin/views/main.py:276 contrib/admin/views/main.py:361
1249 1249
 #, python-format
1250 1250
 msgid "You may add another %s below."
1251  
-msgstr "Pot agregar un altre %s abaix."
  1251
+msgstr "Pot afegir un altre %s a baix."
1252 1252
 
1253 1253
 #: contrib/admin/views/main.py:294
1254 1254
 #, python-format
1255 1255
 msgid "Add %s"
1256  
-msgstr "Agregar %s"
  1256
+msgstr "Afegir %s"
1257 1257
 
1258 1258
 #: contrib/admin/views/main.py:340
1259 1259
 #, python-format
BIN  django/conf/locale/es/LC_MESSAGES/django.mo
Binary file not shown
3,684  django/conf/locale/es/LC_MESSAGES/django.po
2181 additions, 1503 deletions not shown
BIN  django/conf/locale/sl/LC_MESSAGES/django.mo
Binary file not shown
3,932  django/conf/locale/sl/LC_MESSAGES/django.po
2485 additions, 1447 deletions not shown
BIN  django/conf/locale/sl/LC_MESSAGES/djangojs.mo
Binary file not shown
67  django/conf/locale/sl/LC_MESSAGES/djangojs.po
@@ -5,8 +5,8 @@ msgid ""
5 5
 msgstr ""
6 6
 "Project-Id-Version: DJANGO-JS\n"
7 7
 "Report-Msgid-Bugs-To: \n"
8  
-"POT-Creation-Date: 2005-12-09 11:51+0100\n"
9  
-"PO-Revision-Date: 2007-03-31 21:29+0100\n"
  8
+"POT-Creation-Date: 2007-07-02 13:55+0200\n"
  9
+"PO-Revision-Date: 2007-07-02 13:56+0100\n"
10 10
 "Last-Translator: Gasper Koren <skrat@owca.info>\n"
11 11
 "Language-Team: SLOVENIAN <lugos-slo@lugos.si>\n"
12 12
 "MIME-Version: 1.0\n"
@@ -15,6 +15,19 @@ msgstr ""
15 15
 "X-Poedit-Language: Slovenian\n"
16 16
 "X-Poedit-Country: SLOVENIA\n"
17 17
 
  18
+#: contrib/admin/media/js/calendar.js:24
  19
+#: contrib/admin/media/js/dateparse.js:32
  20
+msgid "January February March April May June July August September October November December"
  21
+msgstr "Januar Februar Marec April Maj Junij Julij Avgust September Oktober November December"
  22
+
  23
+#: contrib/admin/media/js/calendar.js:25
  24
+msgid "S M T W T F S"
  25
+msgstr "N P T S Č P S"
  26
+
  27
+#: contrib/admin/media/js/dateparse.js:33
  28
+msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday"
  29
+msgstr "Nedelja Ponedeljek Torek Sreda Četrtek Petek Sobota"
  30
+
18 31
 #: contrib/admin/media/js/SelectFilter2.js:33
19 32
 #, perl-format
20 33
 msgid "Available %s"
@@ -45,63 +58,59 @@ msgstr "Izberite in kliknite"
45 58
 msgid "Clear all"
46 59
 msgstr "Izbriši vse"
47 60
 
48  
-#: contrib/admin/media/js/dateparse.js:26
49  
-#: contrib/admin/media/js/calendar.js:24
50  
-msgid "January February March April May June July August September October November December"
51  
-msgstr "Januar Februar Marec April Maj Junij Julij Avgust September Oktober November December"
52  
-
53  
-#: contrib/admin/media/js/dateparse.js:27
54  
-msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday"
55  
-msgstr "Nedelja Ponedeljek Torek Sreda Četrtek Petek Sobota"
56  
-
57  
-#: contrib/admin/media/js/calendar.js:25
58  
-msgid "S M T W T F S"
59  
-msgstr "N P T S Č P S"
60  
-
61  
-#: contrib/admin/media/js/admin/DateTimeShortcuts.js:45
62  
-#: contrib/admin/media/js/admin/DateTimeShortcuts.js:80
  61
+#: contrib/admin/media/js/admin/DateTimeShortcuts.js:47
  62
+#: contrib/admin/media/js/admin/DateTimeShortcuts.js:81
63 63
 msgid "Now"
64 64
 msgstr "Sedaj"
65 65
 
66  
-#: contrib/admin/media/js/admin/DateTimeShortcuts.js:48
  66
+#: contrib/admin/media/js/admin/DateTimeShortcuts.js:51
67 67
 msgid "Clock"
68 68
 msgstr "URA"
69 69
 
70  
-#: contrib/admin/media/js/admin/DateTimeShortcuts.js:77
  70
+#: contrib/admin/media/js/admin/DateTimeShortcuts.js:78
71 71
 msgid "Choose a time"
72 72
 msgstr "Izberite čas"
73 73
 
74  
-#: contrib/admin/media/js/admin/DateTimeShortcuts.js:81
  74
+#: contrib/admin/media/js/admin/DateTimeShortcuts.js:82
75 75
 msgid "Midnight"
76 76
 msgstr "Polnoč"
77 77
 
78  
-#: contrib/admin/media/js/admin/DateTimeShortcuts.js:82
  78
+#: contrib/admin/media/js/admin/DateTimeShortcuts.js:83
79 79
 msgid "6 a.m."
80 80
 msgstr "Ob 6h"
81 81
 
82  
-#: contrib/admin/media/js/admin/DateTimeShortcuts.js:83
  82
+#: contrib/admin/media/js/admin/DateTimeShortcuts.js:84
83 83
 msgid "Noon"
84 84
 msgstr "Opoldne"
85 85
 
86  
-#: contrib/admin/media/js/admin/DateTimeShortcuts.js:87
87  
-#: contrib/admin/media/js/admin/DateTimeShortcuts.js:168
  86
+#: contrib/admin/media/js/admin/DateTimeShortcuts.js:88
  87
+#: contrib/admin/media/js/admin/DateTimeShortcuts.js:183
88 88
 msgid "Cancel"
89 89
 msgstr "Prekliči"
90 90
 
91  
-#: contrib/admin/media/js/admin/DateTimeShortcuts.js:111
92  
-#: contrib/admin/media/js/admin/DateTimeShortcuts.js:162
  91
+#: contrib/admin/media/js/admin/DateTimeShortcuts.js:128
  92
+#: contrib/admin/media/js/admin/DateTimeShortcuts.js:177
93 93
 msgid "Today"
94 94
 msgstr "Danes"
95 95
 
96  
-#: contrib/admin/media/js/admin/DateTimeShortcuts.js:114
  96
+#: contrib/admin/media/js/admin/DateTimeShortcuts.js:132
97 97
 msgid "Calendar"
98 98
 msgstr "Koledar"
99 99
 
100  
-#: contrib/admin/media/js/admin/DateTimeShortcuts.js:160
  100
+#: contrib/admin/media/js/admin/DateTimeShortcuts.js:175
101 101
 msgid "Yesterday"
102 102
 msgstr "Včeraj"
103 103
 
104  
-#: contrib/admin/media/js/admin/DateTimeShortcuts.js:164
  104
+#: contrib/admin/media/js/admin/DateTimeShortcuts.js:179
105 105
 msgid "Tomorrow"
106 106
 msgstr "Jutri"
107 107
 
  108
+#: contrib/admin/media/js/admin/CollapsedFieldsets.js:34
  109
+#: contrib/admin/media/js/admin/CollapsedFieldsets.js:72
  110
+msgid "Show"
  111
+msgstr "Prikaži"
  112
+
  113
+#: contrib/admin/media/js/admin/CollapsedFieldsets.js:63
  114
+msgid "Hide"
  115
+msgstr "Skrij"
  116
+
14  django/contrib/admin/filterspecs.py
@@ -7,6 +7,8 @@
7 7
 """
8 8
 
9 9
 from django.db import models
  10
+from django.utils.encoding import smart_unicode, iri_to_uri
  11
+from django.utils.translation import ugettext as _
10 12
 import datetime
11 13
 
12 14
 class FilterSpec(object):
@@ -37,12 +39,12 @@ def title(self):
37 39
     def output(self, cl):
38 40
         t = []
39 41
         if self.has_output():
40  
-            t.append(_('<h3>By %s:</h3>\n<ul>\n') % self.title())
  42
+            t.append(_(u'<h3>By %s:</h3>\n<ul>\n') % self.title())
41 43
 
42 44
             for choice in self.choices(cl):
43  
-                t.append('<li%s><a href="%s">%s</a></li>\n' % \
  45
+                t.append(u'<li%s><a href="%s">%s</a></li>\n' % \
44 46
                     ((choice['selected'] and ' class="selected"' or ''),
45  
-                     choice['query_string'] ,
  47
+                     iri_to_uri(choice['query_string']),
46 48
                      choice['display']))
47 49
             t.append('</ul>\n\n')
48 50
         return "".join(t)
@@ -70,7 +72,7 @@ def choices(self, cl):
70 72
                'display': _('All')}
71 73
         for val in self.lookup_choices:
72 74
             pk_val = getattr(val, self.field.rel.to._meta.pk.attname)
73  
-            yield {'selected': self.lookup_val == str(pk_val),
  75
+            yield {'selected': self.lookup_val == smart_unicode(pk_val),
74 76
                    'query_string': cl.get_query_string({self.lookup_kwarg: pk_val}),
75 77
                    'display': val}
76 78
 
@@ -87,7 +89,7 @@ def choices(self, cl):
87 89
                'query_string': cl.get_query_string({}, [self.lookup_kwarg]),
88 90
                'display': _('All')}
89 91
         for k, v in self.field.choices:
90  
-            yield {'selected': str(k) == self.lookup_val,
  92
+            yield {'selected': smart_unicode(k) == self.lookup_val,
91 93
                     'query_string': cl.get_query_string({self.lookup_kwarg: k}),
92 94
                     'display': v}
93 95
 
@@ -168,7 +170,7 @@ def choices(self, cl):
168 170
                'query_string': cl.get_query_string({}, [self.field.name]),
169 171
                'display': _('All')}
170 172
         for val in self.lookup_choices:
171  
-            val = str(val[self.field.name])
  173
+            val = smart_unicode(val[self.field.name])
172 174
             yield {'selected': self.lookup_val == val,
173 175
                    'query_string': cl.get_query_string({self.field.name: val}),
174 176
                    'display': val}
101  django/contrib/admin/media/js/urlify.js
... ...
@@ -1,15 +1,116 @@
  1
+var LATIN_MAP = {
  2
+    'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE', 'Ç':
  3
+    'C', 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ì': 'I', 'Í': 'I', 'Î': 'I',
  4
+    'Ï': 'I', 'Ð': 'D', 'Ñ': 'N', 'Ò': 'O', 'Ó': 'O', 'Ô': 'O', 'Õ': 'O', 'Ö':
  5
+    'O', 'Ø': 'O', 'Ù': 'U', 'Ú': 'U', 'Û': 'U', 'Ü': 'U', 'Ý': 'Y', 'Þ': 'TH',
  6
+    'ß': 'ss', 'à':'a', 'á':'a', 'â': 'a', 'ã': 'a', 'ä': 'a', 'å': 'a', 'æ':
  7
+    'ae', 'ç': 'c', 'è': 'e', 'é': 'e', 'ê': 'e', 'ë': 'e', 'ì': 'i', 'í': 'i',
  8
+    'î': 'i', 'ï': 'i', 'ð': 'o', 'ñ': 'n', 'ò': 'o', 'ó': 'o', 'ô': 'o', 'õ':
  9
+    'o', 'ö': 'o', 'ø': 'o', 'ù': 'u', 'ú': 'u', 'û': 'u', 'ü': 'u', 'ý': 'y',
  10
+    'þ': 'th', 'ÿ': 'y'
  11
+}
  12
+var LATIN_SYMBOLS_MAP = {
  13
+    '©':'(c)'
  14
+}
  15
+var GREEK_MAP = {
  16
+    'α':'a', 'β':'b', 'γ':'g', 'δ':'d', 'ε':'e', 'ζ':'z', 'η':'h', 'θ':'8',
  17
+    'ι':'i', 'κ':'k', 'λ':'l', 'μ':'m', 'ν':'n', 'ξ':'3', 'ο':'o', 'π':'p',
  18
+    'ρ':'r', 'σ':'s', 'τ':'t', 'υ':'y', 'φ':'f', 'χ':'x', 'ψ':'ps', 'ω':'w',
  19
+    'ά':'a', 'έ':'e', 'ί':'i', 'ό':'o', 'ύ':'y', 'ή':'h', 'ώ':'w', 'ς':'s',
  20
+    'ϊ':'i', 'ΰ':'y', 'ϋ':'y', 'ΐ':'i',
  21
+    'Α':'A', 'Β':'B', 'Γ':'G', 'Δ':'D', 'Ε':'E', 'Ζ':'Z', 'Η':'H', 'Θ':'8',
  22
+    'Ι':'I', 'Κ':'K', 'Λ':'L', 'Μ':'M', 'Ν':'N', 'Ξ':'3', 'Ο':'O', 'Π':'P',
  23
+    'Ρ':'R', 'Σ':'S', 'Τ':'T', 'Υ':'Y', 'Φ':'F', 'Χ':'X', 'Ψ':'PS', 'Ω':'W',
  24
+    'Ά':'A', 'Έ':'E', 'Ί':'I', 'Ό':'O', 'Ύ':'Y', 'Ή':'H', 'Ώ':'W', 'Ϊ':'I',
  25
+    'Ϋ':'Y'
  26
+}
  27
+var TURKISH_MAP = {
  28
+    'ş':'s', 'Ş':'S', 'ı':'i', 'İ':'I', 'ç':'c', 'Ç':'C', 'ü':'u', 'Ü':'U',
  29
+    'ö':'o', 'Ö':'O', 'ğ':'g', 'Ğ':'G'
  30
+}
  31
+var RUSSIAN_MAP = {
  32
+    'а':'a', 'б':'b', 'в':'v', 'г':'g', 'д':'d', 'е':'e', 'ё':'yo', 'ж':'zh',
  33
+    'з':'z', 'и':'i', 'й':'j', 'к':'k', 'л':'l', 'м':'m', 'н':'n', 'о':'o',
  34
+    'п':'p', 'р':'r', 'с':'s', 'т':'t', 'у':'u', 'ф':'f', 'х':'h', 'ц':'c',
  35
+    'ч':'ch', 'ш':'sh', 'щ':'sh', 'ъ':'', 'ы':'y', 'ь':'', 'э':'e', 'ю':'yu',
  36
+    'я':'ya',
  37
+    'А':'A', 'Б':'B', 'В':'V', 'Г':'G', 'Д':'D', 'Е':'E', 'Ё':'Yo', 'Ж':'Zh',
  38
+    'З':'Z', 'И':'I', 'Й':'J', 'К':'K', 'Л':'L', 'М':'M', 'Н':'N', 'О':'O',
  39
+    'П':'P', 'Р':'R', 'С':'S', 'Т':'T', 'У':'U', 'Ф':'F', 'Х':'H', 'Ц':'C',
  40
+    'Ч':'Ch', 'Ш':'Sh', 'Щ':'Sh', 'Ъ':'', 'Ы':'Y', 'Ь':'', 'Э':'E', 'Ю':'Yu',
  41
+    'Я':'Ya'
  42
+}
  43
+
  44
+var ALL_DOWNCODE_MAPS=new Array()
  45
+ALL_DOWNCODE_MAPS[0]=LATIN_MAP
  46
+ALL_DOWNCODE_MAPS[1]=LATIN_SYMBOLS_MAP
  47
+ALL_DOWNCODE_MAPS[2]=GREEK_MAP
  48
+ALL_DOWNCODE_MAPS[3]=TURKISH_MAP
  49
+ALL_DOWNCODE_MAPS[4]=RUSSIAN_MAP
  50
+
  51
+var Downcoder = new Object();
  52
+Downcoder.Initialize = function()
  53
+{
  54
+    if (Downcoder.map) // already made
  55
+        return ;
  56
+    Downcoder.map ={}
  57
+    Downcoder.chars = '' ;
  58
+    for(var i in ALL_DOWNCODE_MAPS)
  59
+    {
  60
+        var lookup = ALL_DOWNCODE_MAPS[i]
  61
+        for (var c in lookup)
  62
+        {
  63
+            Downcoder.map[c] = lookup[c] ;
  64
+            Downcoder.chars += c ;
  65
+        }
  66
+     }
  67
+    Downcoder.regex = new RegExp('[' + Downcoder.chars + ']|[^' + Downcoder.chars + ']+','g') ;
  68
+}
  69
+
  70
+downcode= function( slug )
  71
+{
  72
+    Downcoder.Initialize() ;
  73
+    var downcoded =""
  74
+    var pieces = slug.match(Downcoder.regex);
  75
+    if(pieces)
  76
+    {
  77
+        for (var i = 0 ; i < pieces.length ; i++)
  78
+        {
  79
+            if (pieces[i].length == 1)
  80
+            {
  81
+                var mapped = Downcoder.map[pieces[i]] ;
  82
+                if (mapped != null)
  83
+                {
  84
+                    downcoded+=mapped;
  85
+                    continue ;
  86
+                }
  87
+            }
  88
+            downcoded+=pieces[i];
  89
+        }
  90
+    }
  91
+    else
  92
+    {
  93
+        downcoded = slug;
  94
+    }
  95
+    return downcoded;
  96
+}
  97
+
  98
+
1 99
 function URLify(s, num_chars) {
2 100
     // changes, e.g., "Petty theft" to "petty_theft"
3 101
     // remove all these words from the string before urlifying
  102
+    s = downcode(s);
4 103
     removelist = ["a", "an", "as", "at", "before", "but", "by", "for", "from",
5 104
                   "is", "in", "into", "like", "of", "off", "on", "onto", "per",
6 105
                   "since", "than", "the", "this", "that", "to", "up", "via",
7 106
                   "with"];
8 107
     r = new RegExp('\\b(' + removelist.join('|') + ')\\b', 'gi');
9 108
     s = s.replace(r, '');
  109
+    // if downcode doesn't hit, the char will be stripped here
10 110
     s = s.replace(/[^-\w\s]/g, '');  // remove unneeded chars
11 111
     s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces
12 112
     s = s.replace(/[-\s]+/g, '-');   // convert spaces to hyphens
13 113
     s = s.toLowerCase();             // convert to lowercase
14 114
     return s.substring(0, num_chars);// trim to first num_chars chars
15 115
 }
  116
+
9  django/contrib/admin/models.py
... ...
@@ -1,7 +1,8 @@
1 1
 from django.db import models
2 2
 from django.contrib.contenttypes.models import ContentType
3 3
 from django.contrib.auth.models import User
4  
-from django.utils.translation import gettext_lazy as _
  4
+from django.utils.translation import ugettext_lazy as _
  5
+from django.utils.encoding import smart_unicode
5 6
 
6 7
 ADDITION = 1
7 8
 CHANGE = 2
@@ -9,7 +10,7 @@
9 10
 
10 11
 class LogEntryManager(models.Manager):
11 12
     def log_action(self, user_id, content_type_id, object_id, object_repr, action_flag, change_message=''):
12  
-        e = self.model(None, None, user_id, content_type_id, str(object_id), object_repr[:200], action_flag, change_message)
  13
+        e = self.model(None, None, user_id, content_type_id, smart_unicode(object_id), object_repr[:200], action_flag, change_message)
13 14
         e.save()
14 15
 
15 16
 class LogEntry(models.Model):
@@ -28,7 +29,7 @@ class Meta:
28 29
         ordering = ('-action_time',)
29 30
 
30 31
     def __repr__(self):
31  
-        return str(self.action_time)
  32
+        return smart_unicode(self.action_time)
32 33
 
33 34
     def is_addition(self):
34 35
         return self.action_flag == ADDITION
@@ -48,4 +49,4 @@ def get_admin_url(self):
48 49
         Returns the admin URL to edit the object represented by this log entry.
49 50
         This is relative to the Django admin index page.
50 51
         """
51  
-        return "%s/%s/%s/" % (self.content_type.app_label, self.content_type.model, self.object_id)
  52
+        return u"%s/%s/%s/" % (self.content_type.app_label, self.content_type.model, self.object_id)
22  django/contrib/admin/options.py
@@ -9,6 +9,8 @@
9 9
 from django.shortcuts import get_object_or_404, render_to_response
10 10
 from django.utils.html import escape
11 11
 from django.utils.text import capfirst, get_text_list
  12
+from django.utils.translation import ugettext as _
  13
+from django.utils.encoding import force_unicode
12 14
 import sets
13 15
 
14 16
 class IncorrectLookupParameters(Exception):
@@ -50,7 +52,7 @@ def first_field(self):
50 52
 class Fieldset(object):
51 53
     def __init__(self, name=None, fields=(), classes=(), description=None):
52 54
         self.name, self.fields = name, fields
53  
-        self.classes = ' '.join(classes)
  55
+        self.classes = u' '.join(classes)
54 56
         self.description = description
55 57
 
56 58
 class BoundFieldset(object):
@@ -85,15 +87,15 @@ def __init__(self, form, field, is_first):
85 87
     def label_tag(self):
86 88
         classes = []
87 89
         if self.is_checkbox:
88  
-            classes.append('vCheckboxLabel')
  90
+            classes.append(u'vCheckboxLabel')
89 91
             contents = escape(self.field.label)
90 92
         else:
91  
-            contents = escape(self.field.label) + ':'
  93
+            contents = escape(self.field.label) + u':'
92 94
         if self.field.field.required:
93  
-            classes.append('required')
  95
+            classes.append(u'required')
94 96
         if not self.is_first:
95  
-            classes.append('inline')
96  
-        attrs = classes and {'class': ' '.join(classes)} or {}
  97
+            classes.append(u'inline')
  98
+        attrs = classes and {'class': u' '.join(classes)} or {}
97 99
         return self.field.label_tag(contents=contents, attrs=attrs)
98 100
 
99 101
 class BaseModelAdmin(object):
@@ -561,7 +563,7 @@ def delete_view(self, request, object_id):
561 563
 
562 564
         # Populate deleted_objects, a data structure of all related objects that
563 565
         # will also be deleted.
564  
-        deleted_objects = ['%s: <a href="../../%s/">%s</a>' % (capfirst(opts.verbose_name), object_id, escape(str(obj))), []]
  566
+        deleted_objects = [u'%s: <a href="../../%s/">%s</a>' % (force_unicode(capfirst(opts.verbose_name)), object_id, escape(str(obj))), []]
565 567
         perms_needed = sets.Set()
566 568
         _get_deleted_objects(deleted_objects, perms_needed, request.user, obj, opts, 1)
567 569
 
@@ -571,7 +573,7 @@ def delete_view(self, request, object_id):
571 573
             obj_display = str(obj)
572 574
             obj.delete()
573 575
             LogEntry.objects.log_action(request.user.id, ContentType.objects.get_for_model(self.model).id, object_id, obj_display, DELETION)
574  
-            request.user.message_set.create(message=_('The %(name)s "%(obj)s" was deleted successfully.') % {'name': opts.verbose_name, 'obj': obj_display})
  576
+            request.user.message_set.create(message=_('The %(name)s "%(obj)s" was deleted successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': force_unicode(obj_display)})
575 577
             return HttpResponseRedirect("../../")
576 578
         extra_context = {
577 579
             "title": _("Are you sure?"),
@@ -596,7 +598,7 @@ def history_view(self, request, object_id):
596 598
         # If no history was found, see whether this object even exists.
597 599
         obj = get_object_or_404(model, pk=object_id)
598 600
         extra_context = {
599  
-            'title': _('Change history: %s') % obj,
  601
+            'title': _('Change history: %s') % force_unicode(obj),
600 602
             'action_list': action_list,
601 603
             'module_name': capfirst(opts.verbose_name_plural),
602 604
             'object': obj,
@@ -618,7 +620,7 @@ def get_inline_formsets(self):
618 620
 class InlineModelAdmin(BaseModelAdmin):
619 621
     """
620 622
     Options for inline editing of ``model`` instances.
621  
-    
  623
+
622 624
     Provide ``name`` to specify the attribute name of the ``ForeignKey`` from
623 625
     ``model`` to its parent. This is required if ``model`` has more than one
624 626
     ``ForeignKey`` to its parent.
6  django/contrib/admin/sites.py
@@ -4,13 +4,13 @@
4 4
 from django.db.models import Model
5 5
 from django.shortcuts import render_to_response
6 6
 from django.utils.text import capfirst
7  
-from django.utils.translation import gettext_lazy
  7
+from django.utils.translation import ugettext_lazy, ugettext as _
8 8
 import base64
9 9
 import cPickle as pickle
10 10
 import datetime
11 11
 import md5
12 12
 
13  
-ERROR_MESSAGE = gettext_lazy("Please enter a correct username and password. Note that both fields are case-sensitive.")
  13
+ERROR_MESSAGE = ugettext_lazy("Please enter a correct username and password. Note that both fields are case-sensitive.")
14 14
 LOGIN_FORM_KEY = 'this_is_the_login_form'
15 15
 
16 16
 class AlreadyRegistered(Exception):
@@ -199,7 +199,7 @@ def login(self, request):
199 199
         user = authenticate(username=username, password=password)
200 200
         if user is None:
201 201
             message = ERROR_MESSAGE
202  
-            if '@' in username:
  202
+            if u'@' in username:
203 203
                 # Mistakenly entered e-mail address instead of username? Look it up.
204 204
                 try:
205 205
                     user = User.objects.get(email=username)
2  django/contrib/admin/templates/admin/filter.html
@@ -3,6 +3,6 @@
3 3
 <ul>
4 4
 {% for choice in choices %}
5 5
     <li{% if choice.selected %} class="selected"{% endif %}>
6  
-    <a href="{{ choice.query_string }}">{{ choice.display|escape }}</a></li>
  6
+    <a href="{{ choice.query_string|iriencode }}">{{ choice.display|escape }}</a></li>
7 7
 {% endfor %}
8 8
 </ul>
33  django/contrib/admin/templatetags/admin_list.py
@@ -6,7 +6,8 @@
6 6
 from django.utils import dateformat
7 7
 from django.utils.html import escape
8 8
 from django.utils.text import capfirst
9  
-from django.utils.translation import get_date_formats, get_partial_date_formats
  9
+from django.utils.translation import get_date_formats, get_partial_date_formats, ugettext as _
  10
+from django.utils.encoding import smart_unicode, smart_str, force_unicode
10 11
 from django.template import Library
11 12
 import datetime
12 13
 
@@ -16,11 +17,11 @@
16 17
 
17 18
 def paginator_number(cl,i):
18 19
     if i == DOT:
19  
-        return '... '
  20
+        return u'... '
20 21
     elif i == cl.page_num:
21  
-        return '<span class="this-page">%d</span> ' % (i+1)
  22
+        return u'<span class="this-page">%d</span> ' % (i+1)
22 23
     else:
23  
-        return '<a href="%s"%s>%d</a> ' % (cl.get_query_string({PAGE_VAR: i}), (i == cl.paginator.pages-1 and ' class="end"' or ''), i+1)
  24
+        return u'<a href="%s"%s>%d</a> ' % (cl.get_query_string({PAGE_VAR: i}), (i == cl.paginator.pages-1 and ' class="end"' or ''), i+1)
24 25
 paginator_number = register.simple_tag(paginator_number)
25 26
 
26 27
 def pagination(cl):
@@ -75,10 +76,12 @@ def result_headers(cl):
75 76
             admin_order_field = None
76 77
         except models.FieldDoesNotExist:
77 78
             # For non-field list_display values, check for the function
78  
-            # attribute "short_description". If that doesn't exist, fall
79  
-            # back to the method name. And __str__ is a special-case.
80  
-            if field_name == '__str__':
81  
-                header = lookup_opts.verbose_name
  79
+            # attribute "short_description". If that doesn't exist, fall back
  80
+            # to the method name. And __str__ and __unicode__ are special-cases.
  81
+            if field_name == '__unicode__':
  82
+                header = force_unicode(lookup_opts.verbose_name)
  83
+            elif field_name == '__str__':
  84
+                header = smart_str(lookup_opts.verbose_name)
82 85
             else:
83 86
                 attr = getattr(cl.model, field_name) # Let AttributeErrors propagate.
84 87
                 try:
@@ -114,7 +117,7 @@ def result_headers(cl):
114 117
 
115 118
 def _boolean_icon(field_val):
116 119
     BOOLEAN_MAPPING = {True: 'yes', False: 'no', None: 'unknown'}
117  
-    return '<img src="%simg/admin/icon-%s.gif" alt="%s" />' % (settings.ADMIN_MEDIA_PREFIX, BOOLEAN_MAPPING[field_val], field_val)
  120
+    return u'<img src="%simg/admin/icon-%s.gif" alt="%s" />' % (settings.ADMIN_MEDIA_PREFIX, BOOLEAN_MAPPING[field_val], field_val)
118 121
 
119 122
 def items_for_result(cl, result):
120 123
     first = True
@@ -136,7 +139,7 @@ def items_for_result(cl, result):
136 139
                     allow_tags = True
137 140
                     result_repr = _boolean_icon(attr)
138 141
                 else:
139  
-                    result_repr = str(attr)
  142
+                    result_repr = smart_unicode(attr)
140 143
             except (AttributeError, ObjectDoesNotExist):
141 144
                 result_repr = EMPTY_CHANGELIST_VALUE
142 145
             else:
@@ -179,19 +182,19 @@ def items_for_result(cl, result):
179 182
             elif f.choices:
180 183
                 result_repr = dict(f.choices).get(field_val, EMPTY_CHANGELIST_VALUE)
181 184
             else:
182  
-                result_repr = escape(str(field_val))
183  
-        if result_repr == '':
  185
+                result_repr = escape(field_val)
  186
+        if force_unicode(result_repr) == '':
184 187
             result_repr = '&nbsp;'
185 188
         # If list_display_links not defined, add the link tag to the first field
186 189
         if (first and not cl.list_display_links) or field_name in cl.list_display_links:
187 190
             table_tag = {True:'th', False:'td'}[first]
188 191
             first = False
189 192
             url = cl.url_for_result(result)
190  
-            result_id = str(getattr(result, pk)) # str() is needed in case of 23L (long ints)
191  
-            yield ('<%s%s><a href="%s"%s>%s</a></%s>' % \
  193
+            result_id = smart_unicode(getattr(result, pk)) # conversion to string is needed in case of 23L (long ints)
  194
+            yield (u'<%s%s><a href="%s"%s>%s</a></%s>' % \
192 195
                 (table_tag, row_class, url, (cl.is_popup and ' onclick="opener.dismissRelatedLookupPopup(window, %r); return false;"' % result_id or ''), result_repr, table_tag))
193 196
         else:
194  
-            yield ('<td%s>%s</td>' % (row_class, result_repr))
  197
+            yield (u'<td%s>%s</td>' % (row_class, result_repr))
195 198
 
196 199
 def results(cl):
197 200
     for res in cl.result_list:
7  django/contrib/admin/templatetags/admin_modify.py
@@ -2,6 +2,7 @@
2 2
 from django.contrib.admin.views.main import AdminBoundField
3 3
 from django.template import loader
4 4
 from django.utils.text import capfirst
  5
+from django.utils.encoding import force_unicode
5 6
 from django.db import models
6 7
 from django.db.models.fields import Field
7 8
 from django.db.models.related import BoundRelatedObject
@@ -13,7 +14,7 @@
13 14
 word_re = re.compile('[A-Z][a-z]+')
14 15
 
15 16
 def class_name_to_underscored(name):
16  
-    return '_'.join([s.lower() for s in word_re.findall(name)[:-1]])
  17
+    return u'_'.join([s.lower() for s in word_re.findall(name)[:-1]])
17 18
 
18 19
 def submit_row(context):
19 20
     opts = context['opts']
@@ -45,7 +46,7 @@ def get_nodelist(cls, klass):
45 46
         if klass not in cls.nodelists:
46 47
             try:
47 48
                 field_class_name = klass.__name__
48  
-                template_name = "widget/%s.html" % class_name_to_underscored(field_class_name)
  49
+                template_name = u"widget/%s.html" % class_name_to_underscored(field_class_name)
49 50
                 nodelist = loader.get_template(template_name).nodelist
50 51
             except template.TemplateDoesNotExist:
51 52
                 super_klass = bool(klass.__bases__) and klass.__bases__[0] or None
@@ -95,7 +96,7 @@ def __init__(self, field_mapping, fields, index):
95 96
         self.index = index
96 97
 
97 98
 def output_all(form_fields):
98  
-    return ''.join([str(f) for f in form_fields])
  99
+    return u''.join([force_unicode(f) for f in form_fields])
99 100
 output_all = register.simple_tag(output_all)
100 101
 
101 102
 def field_widget(parser, token):
1  django/contrib/admin/views/auth.py
@@ -6,6 +6,7 @@
6 6
 from django.shortcuts import render_to_response, get_object_or_404
7 7
 from django.http import HttpResponseRedirect
8 8
 from django.utils.html import escape
  9
+from django.utils.translation import ugettext as _
9 10
 
10 11
 def user_add_stage(request):
11 12
     if not request.user.has_perm('auth.change_user'):
4  django/contrib/admin/views/decorators.py
@@ -3,11 +3,11 @@
3 3
 from django.contrib.auth.models import User
4 4
 from django.contrib.auth import authenticate, login
5 5
 from django.shortcuts import render_to_response
6  
-from django.utils.translation import gettext_lazy
  6
+from django.utils.translation import ugettext_lazy, ugettext as _
7 7
 import base64, datetime, md5
8 8
 import cPickle as pickle
9 9
 
10  
-ERROR_MESSAGE = gettext_lazy("Please enter a correct username and password. Note that both fields are case-sensitive.")
  10
+ERROR_MESSAGE = ugettext_lazy("Please enter a correct username and password. Note that both fields are case-sensitive.")
11 11
 LOGIN_FORM_KEY = 'this_is_the_login_form'
12 12
 
13 13
 def _display_login_form(request, error_message=''):
44  django/contrib/admin/views/main.py
@@ -12,6 +12,8 @@
12 12
 from django.http import Http404
13 13
 from django.utils.html import escape
14 14
 from django.utils.text import capfirst
  15
+from django.utils.encoding import force_unicode, smart_str
  16
+from django.utils.translation import ugettext as _
15 17
 import operator
16 18
 
17 19
 try:
@@ -77,11 +79,11 @@ def __init__(self, field, field_mapping, original):
77 79
 
78 80
         classes = []
79 81
         if self.raw_id_admin:
80  
-            classes.append('nowrap')
  82
+            classes.append(u'nowrap')
81 83
         if max([bool(f.errors()) for f in self.form_fields]):
82  
-            classes.append('error')
  84
+            classes.append(u'error')
83 85
         if classes:
84  
-            self.cell_class_attribute = ' class="%s" ' % ' '.join(classes)
  86
+            self.cell_class_attribute = u' class="%s" ' % ' '.join(classes)
85 87
         self._repr_filled = False
86 88
 
87 89
     def original_value(self):
@@ -93,9 +95,9 @@ def existing_display(self):
93 95
             return self._display
94 96
         except AttributeError:
95 97
             if isinstance(self.field.rel, models.ManyToOneRel):
96  
-                self._display = getattr(self.original, self.field.name)
  98
+                self._display = force_unicode(getattr(self.original, self.field.name), strings_only=True)
97 99
             elif isinstance(self.field.rel, models.ManyToManyRel):
98  
-                self._display = ", ".join([str(obj) for obj in getattr(self.original, self.field.name).all()])
  100
+                self._display = u", ".join([force_unicode(obj) for obj in getattr(self.original, self.field.name).all()])
99 101
             return self._display
100 102
 
101 103
     def __repr__(self):
@@ -173,11 +175,11 @@ def _get_deleted_objects(deleted_objects, perms_needed, user, obj, opts, current
173 175
                 if related.field.rel.edit_inline or not related.opts.admin:
174 176
                     # Don't display link to edit, because it either has no
175 177
                     # admin or is edited inline.
176  
-                    nh(deleted_objects, current_depth, ['%s: %s' % (capfirst(related.opts.verbose_name), sub_obj), []])
  178
+                    nh(deleted_objects, current_depth, [u'%s: %s' % (force_unicode(capfirst(related.opts.verbose_name)), sub_obj), []])
177 179
                 else:
178 180
                     # Display a link to the admin page.
179  
-                    nh(deleted_objects, current_depth, ['%s: <a href="../../../../%s/%s/%s/">%s</a>' % \
180  
-                        (capfirst(related.opts.verbose_name), related.opts.app_label, related.opts.object_name.lower(),
  181
+                    nh(deleted_objects, current_depth, [u'%s: <a href="../../../../%s/%s/%s/">%s</a>' % \
  182
+                        (force_unicode(capfirst(related.opts.verbose_name)), related.opts.app_label, related.opts.object_name.lower(),
181 183
                         sub_obj._get_pk_val(), sub_obj), []])
182 184
                 _get_deleted_objects(deleted_objects, perms_needed, user, sub_obj, related.opts, current_depth+2)
183 185
         else:
@@ -187,11 +189,11 @@ def _get_deleted_objects(deleted_objects, perms_needed, user, obj, opts, current
187 189
                 if related.field.rel.edit_inline or not related.opts.admin:
188 190
                     # Don't display link to edit, because it either has no
189 191
                     # admin or is edited inline.
190  
-                    nh(deleted_objects, current_depth, ['%s: %s' % (capfirst(related.opts.verbose_name), escape(str(sub_obj))), []])
  192
+                    nh(deleted_objects, current_depth, [u'%s: %s' % (force_unicode(capfirst(related.opts.verbose_name)), escape(sub_obj)), []])
191 193
                 else:
192 194
                     # Display a link to the admin page.
193  
-                    nh(deleted_objects, current_depth, ['%s: <a href="../../../../%s/%s/%s/">%s</a>' % \
194  
-                        (capfirst(related.opts.verbose_name), related.opts.app_label, related.opts.object_name.lower(), sub_obj._get_pk_val(), escape(str(sub_obj))), []])
  195
+                    nh(deleted_objects, current_depth, [u'%s: <a href="../../../../%s/%s/%s/">%s</a>' % \
  196
+                        (force_unicode(capfirst(related.opts.verbose_name)), related.opts.app_label, related.opts.object_name.lower(), sub_obj._get_pk_val(), escape(sub_obj)), []])
195 197
                 _get_deleted_objects(deleted_objects, perms_needed, user, sub_obj, related.opts, current_depth+2)
196 198
             # If there were related objects, and the user doesn't have
197 199
             # permission to delete them, add the missing perm to perms_needed.
@@ -218,17 +220,17 @@ def _get_deleted_objects(deleted_objects, perms_needed, user, obj, opts, current
218 220
                     # Don't display link to edit, because it either has no
219 221
                     # admin or is edited inline.
220 222
                     nh(deleted_objects, current_depth, [_('One or more %(fieldname)s in %(name)s: %(obj)s') % \
221  
-                        {'fieldname': related.field.verbose_name, 'name': related.opts.verbose_name, 'obj': escape(str(sub_obj))}, []])
  223
+                        {'fieldname': force_unicode(related.field.verbose_name), 'name': force_unicode(related.opts.verbose_name), 'obj': escape(sub_obj)}, []])
222 224
                 else:
223 225
                     # Display a link to the admin page.
224 226
                     nh(deleted_objects, current_depth, [
225  
-                        (_('One or more %(fieldname)s in %(name)s:') % {'fieldname': related.field.verbose_name, 'name':related.opts.verbose_name}) + \
226  
-                        (' <a href="../../../../%s/%s/%s/">%s</a>' % \
227  
-                            (related.opts.app_label, related.opts.module_name, sub_obj._get_pk_val(), escape(str(sub_obj)))), []])
  227
+                        (_('One or more %(fieldname)s in %(name)s:') % {'fieldname': force_unicode(related.field.verbose_name), 'name': force_unicode(related.opts.verbose_name)}) + \
  228
+                        (u' <a href="../../../../%s/%s/%s/">%s</a>' % \
  229
+                            (related.opts.app_label, related.opts.module_name, sub_obj._get_pk_val(), escape(sub_obj))), []])
228 230
         # If there were related objects, and the user doesn't have
229 231
         # permission to change them, add the missing perm to perms_needed.
230 232
         if related.opts.admin and has_related_objs:
231  
-            p = '%s.%s' % (related.opts.app_label, related.opts.get_change_permission())
  233
+            p = u'%s.%s' % (related.opts.app_label, related.opts.get_change_permission())
232 234
             if not user.has_perm(p):
233 235
                 perms_needed.add(related.opts.verbose_name)
234 236
 
@@ -264,7 +266,7 @@ def __init__(self, request, model, list_display, list_display_links, list_filter
264 266
         self.query = request.GET.get(SEARCH_VAR, '')
265 267
         self.query_set = self.get_query_set()
266 268
         self.get_results(request)
267  
-        self.title = (self.is_popup and _('Select %s') % self.opts.verbose_name or _('Select %s to change') % self.opts.verbose_name)
  269
+        self.title = (self.is_popup and _('Select %s') % force_unicode(self.opts.verbose_name) or _('Select %s to change') % force_unicode(self.opts.verbose_name))
268 270
         self.filter_specs, self.has_filters = self.get_filters(request)
269 271
         self.pk_attname = self.lookup_opts.pk.attname
270 272
 
@@ -291,7 +293,7 @@ def get_query_string(self, new_params=None, remove=None):
291 293
                 del p[k]
292 294
             elif v is not None:
293 295
                 p[k] = v
294  
-        return '?' + '&amp;'.join(['%s=%s' % (k, v) for k, v in p.items()]).replace(' ', '%20')
  296
+        return '?' + '&amp;'.join([u'%s=%s' % (k, v) for k, v in p.items()]).replace(' ', '%20')
295 297
 
296 298
     def get_results(self, request):
297 299
         paginator = ObjectPaginator(self.query_set, self.list_per_page)
@@ -377,6 +379,12 @@ def get_query_set(self):
377 379
         for i in (ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR, IS_POPUP_VAR):
378 380
             if i in lookup_params:
379 381
                 del lookup_params[i]
  382
+        for key, value in lookup_params.items():
  383
+            if not isinstance(key, str):
  384
+                # 'key' will be used as a keyword argument later, so Python
  385
+                # requires it to be a string.
  386
+                del lookup_params[key]
  387
+                lookup_params[smart_str(key)] = value
380 388
 
381 389
         # Apply lookup parameters from the query string.
382 390
         qs = qs.filter(**lookup_params)
1  django/contrib/admin/widgets.py
@@ -4,6 +4,7 @@
4 4
 
5 5
 from django import newforms as forms
6 6
 from django.utils.text import capfirst
  7
+from django.utils.translation import ugettext as _
7 8
 
8 9
 class FilteredSelectMultiple(forms.SelectMultiple):
9 10
     """
2  django/contrib/auth/forms.py
@@ -4,7 +4,7 @@
4 4
 from django.template import Context, loader
5 5
 from django.core import validators
6 6
 from django import oldforms
7  
-from django.utils.translation import gettext as _
  7
+from django.utils.translation import ugettext as _
8 8
 
9 9
 class UserCreationForm(oldforms.Manipulator):
10 10
     "A form that creates a user, with no privileges, from the given username and password."
4  django/contrib/auth/management.py
@@ -7,13 +7,13 @@
7 7
 from django.contrib.auth import models as auth_app
8 8
 
9 9
 def _get_permission_codename(action, opts):
10  
-    return '%s_%s' % (action, opts.object_name.lower())
  10
+    return u'%s_%s' % (action, opts.object_name.lower())
11 11
 
12 12
 def _get_all_permissions(opts):
13 13
     "Returns (codename, name) for all permissions in the given opts."
14 14
     perms = []
15 15
     for action in ('add', 'change', 'delete'):
16  
-        perms.append((_get_permission_codename(action, opts), 'Can %s %s' % (action, opts.verbose_name)))
  16
+        perms.append((_get_permission_codename(action, opts), u'Can %s %s' % (action, opts.verbose_name_raw)))
17 17
     return perms + list(opts.permissions)
18 18
 
19 19
 def create_permissions(app, created_models, verbosity):
35  django/contrib/auth/models.py
@@ -2,8 +2,10 @@
2 2
 from django.core.exceptions import ImproperlyConfigured
3 3
 from django.db import backend, connection, models
4 4
 from django.contrib.contenttypes.models import ContentType
5  
-from django.utils.translation import gettext_lazy as _
  5
+from django.utils.encoding import smart_str
  6
+from django.utils.translation import ugettext_lazy as _
6 7
 import datetime
  8
+import urllib
7 9
 
8 10
 try:
9 11
     set
@@ -18,16 +20,16 @@ def check_password(raw_password, enc_password):
18 20
     algo, salt, hsh = enc_password.split('$')
19 21
     if algo == 'md5':
20 22
         import md5
21  
-        return hsh == md5.new(salt+raw_password).hexdigest()
  23
+        return hsh == md5.new(smart_str(salt + raw_password)).hexdigest()
22 24
     elif algo == 'sha1':
23 25
         import sha
24  
-        return hsh == sha.new(salt+raw_password).hexdigest()
  26
+        return hsh == sha.new(smart_str(salt + raw_password)).hexdigest()
25 27
     elif algo == 'crypt':
26 28
         try:
27 29
             import crypt
28 30
         except ImportError:
29 31
             raise ValueError, "Crypt password algorithm not supported in this environment."
30  
-        return hsh == crypt.crypt(raw_password, salt)
  32
+        return hsh == crypt.crypt(smart_str(raw_password), smart_str(salt))
31 33
     raise ValueError, "Got unknown password algorithm type in password."
32 34
 
33 35
 class SiteProfileNotAvailable(Exception):
@@ -56,8 +58,8 @@ class Meta:
56 58
         unique_together = (('content_type', 'codename'),)
57 59
         ordering = ('content_type', 'codename')
58 60
 
59  
-    def __str__(self):
60  
-        return "%s | %s | %s" % (self.content_type.app_label, self.content_type, self.name)
  61
+    def __unicode__(self):
  62
+        return u"%s | %s | %s" % (self.content_type.app_label, self.content_type, self.name)
61 63
 
62 64
 class Group(models.Model):
63 65
     """Groups are a generic way of categorizing users to apply permissions, or some other label, to those users. A user can belong to any number of groups.
@@ -74,7 +76,7 @@ class Meta:
74 76
         verbose_name_plural = _('groups')
75 77
         ordering = ('name',)
76 78
 
77  
-    def __str__(self):
  79
+    def __unicode__(self):
78 80
         return self.name
79 81
 
80 82
 class UserManager(models.Manager):
@@ -118,11 +120,11 @@ class Meta:
118 120
         verbose_name_plural = _('users')
119 121
         ordering = ('username',)
120 122
 
121  
-    def __str__(self):
  123
+    def __unicode__(self):
122 124
         return self.username
123 125
 
124 126
     def get_absolute_url(self):
125  
-        return "/users/%s/" % self.username
  127
+        return "/users/%s/" % urllib.quote(smart_str(self.username))
126 128
 
127 129
     def is_anonymous(self):
128 130
         "Always returns False. This is a way of comparing User objects to anonymous users."
@@ -135,14 +137,14 @@ def is_authenticated(self):
135 137
 
136 138
     def get_full_name(self):
137 139
         "Returns the first_name plus the last_name, with a space in between."
138  
-        full_name = '%s %s' % (self.first_name, self.last_name)
  140
+        full_name = u'%s %s' % (self.first_name, self.last_name)
139 141
         return full_name.strip()
140 142
 
141 143
     def set_password(self, raw_password):
142 144
         import sha, random
143 145
         algo = 'sha1'
144 146
         salt = sha.new(str(random.random())).hexdigest()[:5]
145  
-        hsh = sha.new(salt+raw_password).hexdigest()
  147
+        hsh = sha.new(salt + smart_str(raw_password)).hexdigest()
146 148
         self.password = '%s$%s$%s' % (algo, salt, hsh)
147 149
 
148 150
     def check_password(self, raw_password):
@@ -154,7 +156,7 @@ def check_password(self, raw_password):
154 156
         # algorithm or salt.
155 157
         if '$' not in self.password:
156 158
             import md5
157  
-            is_correct = (self.password == md5.new(raw_password).hexdigest())
  159
+            is_correct = (self.password == md5.new(smart_str(raw_password)).hexdigest())
158 160
             if is_correct:
159 161
                 # Convert the password to the new, more secure format.
160 162
                 self.set_password(raw_password)
@@ -194,7 +196,7 @@ def get_group_permissions(self):
194 196
 
195 197
     def get_all_permissions(self):
196 198
         if not hasattr(self, '_perm_cache'):
197  
-            self._perm_cache = set(["%s.%s" % (p.content_type.app_label, p.codename) for p in self.user_permissions.select_related()])
  199
+            self._perm_cache = set([u"%s.%s" % (p.content_type.app_label, p.codename) for p in self.user_permissions.select_related()])
198 200
             self._perm_cache.update(self.get_group_permissions())
199 201
         return self._perm_cache
200 202
 
@@ -256,7 +258,7 @@ class Message(models.Model):
256 258
     user = models.ForeignKey(User)
257 259
     message = models.TextField(_('message'))
258 260
 
259  
-    def __str__(self):
  261
+    def __unicode__(self):
260 262
         return self.message
261