From 1db708d4d76850a02aeeb9dafe36beac641ac7dd Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Wed, 4 Jan 2006 17:06:16 +0000 Subject: [PATCH] magic-removal: Merged to [1817] git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1818 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/bin/compile-messages.py | 2 +- django/bin/make-messages.py | 4 +- django/conf/locale/sk/LC_MESSAGES/django.mo | Bin 30586 -> 30819 bytes django/conf/locale/sk/LC_MESSAGES/django.po | 298 +++++++++---------- django/contrib/redirects/middleware.py | 2 +- django/core/cache.py | 37 ++- django/core/template/defaultfilters.py | 12 +- django/middleware/common.py | 2 +- django/utils/httpwrappers.py | 6 + django/utils/timesince.py | 6 +- django/views/generic/simple.py | 20 +- docs/cache.txt | 6 + docs/request_response.txt | 9 +- docs/url_dispatch.txt | 2 +- tests/othertests/defaultfilters.py | 310 ++++++++++++++++++++ tests/runtests.py | 2 +- 16 files changed, 543 insertions(+), 175 deletions(-) diff --git a/django/bin/compile-messages.py b/django/bin/compile-messages.py index 0b5127f6b2..30a92737d8 100755 --- a/django/bin/compile-messages.py +++ b/django/bin/compile-messages.py @@ -19,6 +19,6 @@ for (dirpath, dirnames, filenames) in os.walk(basedir): if file.endswith('.po'): sys.stderr.write('processing file %s in %s\n' % (file, dirpath)) pf = os.path.splitext(os.path.join(dirpath, file))[0] - cmd = 'msgfmt -o %s.mo %s.po' % (pf, pf) + cmd = 'msgfmt -o "%s.mo" "%s.po"' % (pf, pf) os.system(cmd) diff --git a/django/bin/make-messages.py b/django/bin/make-messages.py index e8c21db70f..bb43ca2f9b 100755 --- a/django/bin/make-messages.py +++ b/django/bin/make-messages.py @@ -118,7 +118,7 @@ for lang in languages: os.unlink(os.path.join(dirpath, thefile)) if os.path.exists(potfile): - (stdin, stdout, stderr) = os.popen3('msguniq %s' % potfile, 'b') + (stdin, stdout, stderr) = os.popen3('msguniq "%s"' % potfile, 'b') msgs = stdout.read() errors = stderr.read() if errors: @@ -127,7 +127,7 @@ for lang in languages: sys.exit(8) open(potfile, 'w').write(msgs) if os.path.exists(pofile): - (stdin, stdout, stderr) = os.popen3('msgmerge -q %s %s' % (pofile, potfile), 'b') + (stdin, stdout, stderr) = os.popen3('msgmerge -q "%s" "%s"' % (pofile, potfile), 'b') msgs = stdout.read() errors = stderr.read() if errors: diff --git a/django/conf/locale/sk/LC_MESSAGES/django.mo b/django/conf/locale/sk/LC_MESSAGES/django.mo index 87aa4142a99fd43d4ad9c44d5cf59739d587ebf2..492849a4b44500fc00c1ace37b9120f96041a6ae 100644 GIT binary patch delta 6919 zcmYk=33OD|9mnxIkPu=LAS?-41}20M2#|!ZgiV1!2oTxV5Ktz`kc1@(*-!*VQSeX- zim#{$M})E?h=5k5;t~)Q7pS6ED+nq`ErMFBZL#+I%e$U-4lkek|KB%ve{XF6^^NEA z>z?4b)*%}VpK^~eiC7Y0%w@_?#wcsds1C;bj(9Y-AU@a8m|VPy$=KUx%oLoCj$L2U6L$Ma? za0y1?b<_aRpg&J!ynD)AJ_(Opa#$?g$rX* z`L3t|4#p51iE20>)!r1;_li*inuj~F9tWVe3+t~vnNA@Z7owIfi1D}|~0Vt7~9Uwf2Aqz2|D zy8;Q=jJTUM6V*_*jfY|r;yet+F*ZK|hZ0Z6Fnkm>kS9i8wB!IPMZgVK%ZhsD?zA4ARfG&aQ#P~ZC)HPDNwz5W4pNLysM9d$yjKsSuSKFA6N zO%4TpF&FjDnSm^dsl*nz3AJQbyCs7T*i#lYVB4aQi93Y*s-l+CV zQTgTAOwa#*3Tp5Os>2ttCBB7v3jSjAKVlqlGftcau@lBhiW*3UiBlDjhfLE z)ctc&^$SrGsY5OK64VwxkGJFds1@wP>n|UR2eAHZt9goq{0w6-dZ2qlS7fzJE$UG2 zMGfEsX1Bv57)#<5YOg;> zR?EaNjT9V#-9qM?L3TQTZKMfcr5O!+7g-#0*q}<56d23TnW&*|;3Ff;FiAwje7KG&?Bh zketO*yohYK8I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@nBo{qCP3%@~Lnr7rg@~<`7PC+k@J*d=PKy`Qf!({TGLZO_ug%=;kVqAwj!sbhCgZZq3&X2|yaUqVv zh^g++KMV=N-RiUTlbnmd3c)5yObo1Ij!fz1Kzi?P$)6jh^k zc^#(WH`oiC&9Hw!U@-9}Y>eAbnc8LDYdwI0)E~wqd=DGocYX@G@hWOTx@bjqoyN;tkY9+VZ;7X3fG-ti?sR7;`azPFPKohZ>N769vuS71Ti9 zu)d9&$q|geilWcCcKLo7*p$R@)Fd*Mk4+B&14E5 zDrR9bthE0V%#qXzgAYQ|ep8QG2@xEq_}VQhi_MxFoG#y3&zHkspQC=N9tAGXl* zpGQF{9cV9@Sbu`AV+^PMY3mxyBHo5U_$g{8=TQT^hU(}JYAHeDUbpIh zycCC_Uxfr)(ZSl)T5KI=9giB=!>AN4vh^!adt)zseZ0hp92eZM{->U$1nQzWs+}n@@!kQH267DIILX=na`04|GU8#*mYB4t zE|eN`=-Wb{D;yo2FJcNjeI0LX>&jftwcz+2_5HDwaiy_?scWSR`3$k=RUYc3#3zp%Nli-* z?K6EcesjfFZdLu8c{ueU91e9A_L}y1lsI4aajfSUOC7tW{y$you$QwfK0ZC2+GmOM z(FW{hTTr}=qmbh?2Tzh|>s*WX1t)REe4=cpO+taE#2J$i?dk12l8_wy0B5#vX0o#- zVP@|d+tM~_+Su|c%FQ`C5U1!$j!epBxP*hJqW*#IN8MG*J)Gg*G*2gIu{S!nJ9SS{ zcb~I`9oxq_NZknP^eJ-AdXv35Hqx&IA8Fva|y diff --git a/django/conf/locale/sk/LC_MESSAGES/django.po b/django/conf/locale/sk/LC_MESSAGES/django.po index 928d7a2bc1..9b9ef9080c 100644 --- a/django/conf/locale/sk/LC_MESSAGES/django.po +++ b/django/conf/locale/sk/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-12-29 00:05+0100\n" +"POT-Creation-Date: 2005-12-30 23:37-0500\n" "PO-Revision-Date: 2005-11-10 23:22-0500\n" "Last-Translator: Vladimir Labath \n" "Language-Team: Slovak \n" @@ -16,6 +16,37 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +#: contrib/redirects/models/redirects.py:7 +msgid "redirect from" +msgstr "presmerovaný z" + +#: contrib/redirects/models/redirects.py:8 +msgid "" +"This should be an absolute path, excluding the domain name. Example: '/" +"events/search/'." +msgstr "" +"Tu by sa mala použiť absolútna cesta, bez domény. Napr.: '/events/search/'." + +#: contrib/redirects/models/redirects.py:9 +msgid "redirect to" +msgstr "presmerovaný na " + +#: contrib/redirects/models/redirects.py:10 +msgid "" +"This can be either an absolute path (as above) or a full URL starting with " +"'http://'." +msgstr "" +"Tu môže byť buď absolútna cesta (ako hore) alebo plné URL začínajúce s " +"'http://'." + +#: contrib/redirects/models/redirects.py:12 +msgid "redirect" +msgstr "presmerovanie" + +#: contrib/redirects/models/redirects.py:13 +msgid "redirects" +msgstr "presmerovania" + #: contrib/comments/models/comments.py:8 #: contrib/comments/models/comments.py:161 msgid "object ID" @@ -286,6 +317,58 @@ msgstr "" msgid "The comment form didn't provide either 'preview' or 'post'" msgstr "Formulár komentára neposkytuje odpoveď buď 'prezri' alebo 'pošli'" +#: contrib/flatpages/models/flatpages.py:6 contrib/admin/views/doc.py:267 +msgid "URL" +msgstr "URL" + +#: contrib/flatpages/models/flatpages.py:7 +msgid "" +"Example: '/about/contact/'. Make sure to have leading and trailing slashes." +msgstr "" +"Príklad: '/about/contact/'. Uistite sa, že máte vložené ako úvodné tak aj " +"záverečné lomítka." + +#: contrib/flatpages/models/flatpages.py:8 +msgid "title" +msgstr "názov" + +#: contrib/flatpages/models/flatpages.py:9 +msgid "content" +msgstr "obsah" + +#: contrib/flatpages/models/flatpages.py:10 +msgid "enable comments" +msgstr "povolené komentáre" + +#: contrib/flatpages/models/flatpages.py:11 +msgid "template name" +msgstr "meno predlohy" + +#: contrib/flatpages/models/flatpages.py:12 +msgid "" +"Example: 'flatpages/contact_page'. If this isn't provided, the system will " +"use 'flatpages/default'." +msgstr "" +"Príklad: 'flatpages/contact_page'. Ak sa toto nevykonalo, systém použije " +"'flatpages/default'." + +#: contrib/flatpages/models/flatpages.py:13 +msgid "registration required" +msgstr "musíte byť zaregistrovaný" + +#: contrib/flatpages/models/flatpages.py:13 +msgid "If this is checked, only logged-in users will be able to view the page." +msgstr "" +"Ak je toto označené, potom len prihlásený užívateľ môže vidieť túto stránku." + +#: contrib/flatpages/models/flatpages.py:17 +msgid "flat page" +msgstr "plochá stránka" + +#: contrib/flatpages/models/flatpages.py:18 +msgid "flat pages" +msgstr "ploché stránky" + #: contrib/admin/filterspecs.py:40 #, python-format msgid "" @@ -563,10 +646,6 @@ msgstr "Text" msgid "Time" msgstr "Čas" -#: contrib/admin/views/doc.py:267 contrib/flatpages/models/flatpages.py:6 -msgid "URL" -msgstr "URL" - #: contrib/admin/views/doc.py:268 msgid "U.S. state (two uppercase letters)" msgstr "U.S. štát (dve veľké písmena)" @@ -575,11 +654,27 @@ msgstr "U.S. štát (dve veľké písmena)" msgid "XML text" msgstr "XML text" +#: contrib/admin/templates/widget/date_time.html:3 +msgid "Date:" +msgstr "" + +#: contrib/admin/templates/widget/date_time.html:4 +msgid "Time:" +msgstr "Čas" + +#: contrib/admin/templates/widget/file.html:2 +msgid "Currently:" +msgstr "" + +#: contrib/admin/templates/widget/file.html:3 +msgid "Change:" +msgstr "Zmeň:" + #: contrib/admin/templates/admin/object_history.html:3 #: contrib/admin/templates/admin/change_list.html:4 +#: contrib/admin/templates/admin/change_form.html:9 #: contrib/admin/templates/admin/base.html:23 #: contrib/admin/templates/admin/delete_confirmation.html:3 -#: contrib/admin/templates/admin/change_form.html:9 #: contrib/admin/templates/admin_doc/bookmarklets.html:4 #: contrib/admin/templates/admin_doc/view_detail.html:4 #: contrib/admin/templates/admin_doc/template_tag_index.html:5 @@ -595,9 +690,9 @@ msgstr "Zmena hesla" #: contrib/admin/templates/admin/object_history.html:3 #: contrib/admin/templates/admin/change_list.html:4 +#: contrib/admin/templates/admin/change_form.html:9 #: contrib/admin/templates/admin/base.html:23 #: contrib/admin/templates/admin/delete_confirmation.html:3 -#: contrib/admin/templates/admin/change_form.html:9 #: contrib/admin/templates/admin_doc/bookmarklets.html:4 #: contrib/admin/templates/admin_doc/view_detail.html:4 #: contrib/admin/templates/admin_doc/template_tag_index.html:5 @@ -612,10 +707,10 @@ msgid "Log out" msgstr "Odhlásenie" #: contrib/admin/templates/admin/object_history.html:5 -#: contrib/admin/templates/admin/500.html:4 #: contrib/admin/templates/admin/change_list.html:5 -#: contrib/admin/templates/admin/base.html:29 +#: contrib/admin/templates/admin/500.html:4 #: contrib/admin/templates/admin/change_form.html:12 +#: contrib/admin/templates/admin/base.html:29 #: contrib/admin/templates/registration/password_change_done.html:4 #: contrib/admin/templates/registration/password_reset_form.html:4 #: contrib/admin/templates/registration/logged_out.html:4 @@ -654,13 +749,15 @@ msgstr "" "Tento object nemá históriu zmien. Možno nebol pridaný prostredníctvom tohoto " "web admina" -#: contrib/admin/templates/admin/base_site.html:4 -msgid "Django site admin" -msgstr "Django web admin" +#: contrib/admin/templates/admin/change_list.html:10 +#, python-format +msgid "Add %(name)s" +msgstr "" -#: contrib/admin/templates/admin/base_site.html:7 -msgid "Django administration" -msgstr "Administrácia Django" +#: contrib/admin/templates/admin/filter.html:2 +#, python-format +msgid " By %(title)s " +msgstr " Od %(title)s " #: contrib/admin/templates/admin/500.html:4 msgid "Server error" @@ -682,14 +779,17 @@ msgstr "" "Vznikla chyba. Prostredníctvom e-mailu bol o nej informovaný správca a " "chyba by mala byť o chviľu odstránená. Ďakujeme za vašu trpezlivosť." -#: contrib/admin/templates/admin/404.html:4 -#: contrib/admin/templates/admin/404.html:8 -msgid "Page not found" -msgstr "Stránka nebola nájdená" +#: contrib/admin/templates/admin/search_form.html:8 +msgid "Go" +msgstr "Choď" -#: contrib/admin/templates/admin/404.html:10 -msgid "We're sorry, but the requested page could not be found." -msgstr "Ľutujeme, ale požadovaná stránka nebola nájdená." +#: contrib/admin/templates/admin/base_site.html:4 +msgid "Django site admin" +msgstr "Django web admin" + +#: contrib/admin/templates/admin/base_site.html:7 +msgid "Django administration" +msgstr "Administrácia Django" #: contrib/admin/templates/admin/index.html:27 #: contrib/admin/templates/admin/change_form.html:14 @@ -716,10 +816,14 @@ msgstr "Moje udalosti" msgid "None available" msgstr "Nepovolené" -#: contrib/admin/templates/admin/change_list.html:10 -#, python-format -msgid "Add %(name)s" -msgstr "" +#: contrib/admin/templates/admin/404.html:4 +#: contrib/admin/templates/admin/404.html:8 +msgid "Page not found" +msgstr "Stránka nebola nájdená" + +#: contrib/admin/templates/admin/404.html:10 +msgid "We're sorry, but the requested page could not be found." +msgstr "Ľutujeme, ale požadovaná stránka nebola nájdená." #: contrib/admin/templates/admin/login.html:15 msgid "Username:" @@ -733,6 +837,24 @@ msgstr "Heslo:" msgid "Have you forgotten your password?" msgstr "Zabudli ste vaše heslo?" +#: contrib/admin/templates/admin/change_form.html:20 +msgid "View on site" +msgstr "Pozri na webe" + +#: contrib/admin/templates/admin/change_form.html:28 +msgid "Please correct the error below." +msgid_plural "Please correct the errors below." +msgstr[0] "Opravte chybu, čo je nižšie, prosím." +msgstr[1] "Opravte chyby, čo sú nižšie, prosím." + +#: contrib/admin/templates/admin/change_form.html:45 +msgid "Ordering" +msgstr "Určenie" + +#: contrib/admin/templates/admin/change_form.html:48 +msgid "Order:" +msgstr "Poradie:" + #: contrib/admin/templates/admin/base.html:23 msgid "Welcome," msgstr "Vítajte," @@ -761,33 +883,6 @@ msgstr "" msgid "Yes, I'm sure" msgstr "Ano, som si istý" -#: contrib/admin/templates/admin/filter.html:2 -#, python-format -msgid " By %(title)s " -msgstr " Od %(title)s " - -#: contrib/admin/templates/admin/search_form.html:7 -msgid "Go" -msgstr "Choď" - -#: contrib/admin/templates/admin/change_form.html:20 -msgid "View on site" -msgstr "Pozri na webe" - -#: contrib/admin/templates/admin/change_form.html:28 -msgid "Please correct the error below." -msgid_plural "Please correct the errors below." -msgstr[0] "Opravte chybu, čo je nižšie, prosím." -msgstr[1] "Opravte chyby, čo sú nižšie, prosím." - -#: contrib/admin/templates/admin/change_form.html:45 -msgid "Ordering" -msgstr "Určenie" - -#: contrib/admin/templates/admin/change_form.html:48 -msgid "Order:" -msgstr "Poradie:" - #: contrib/admin/templates/admin/submit_line.html:3 msgid "Delete" msgstr "Vymazať" @@ -996,101 +1091,6 @@ msgstr "Editujte tento objekt (nové okno)" msgid "As above, but opens the admin page in a new window." msgstr "Ako vyššie, ale stranka admina sa otvorí v novom okne." -#: contrib/admin/templates/widget/date_time.html:3 -msgid "Date:" -msgstr "" - -#: contrib/admin/templates/widget/date_time.html:4 -msgid "Time:" -msgstr "Čas" - -#: contrib/admin/templates/widget/file.html:2 -msgid "Currently:" -msgstr "" - -#: contrib/admin/templates/widget/file.html:3 -msgid "Change:" -msgstr "Zmeň:" - -#: contrib/redirects/models/redirects.py:7 -msgid "redirect from" -msgstr "presmerovaný z" - -#: contrib/redirects/models/redirects.py:8 -msgid "" -"This should be an absolute path, excluding the domain name. Example: '/" -"events/search/'." -msgstr "" -"Tu by sa mala použiť absolútna cesta, bez domény. Napr.: '/events/search/'." - -#: contrib/redirects/models/redirects.py:9 -msgid "redirect to" -msgstr "presmerovaný na " - -#: contrib/redirects/models/redirects.py:10 -msgid "" -"This can be either an absolute path (as above) or a full URL starting with " -"'http://'." -msgstr "" -"Tu môže byť buď absolútna cesta (ako hore) alebo plné URL začínajúce s " -"'http://'." - -#: contrib/redirects/models/redirects.py:12 -msgid "redirect" -msgstr "presmerovanie" - -#: contrib/redirects/models/redirects.py:13 -msgid "redirects" -msgstr "presmerovania" - -#: contrib/flatpages/models/flatpages.py:7 -msgid "" -"Example: '/about/contact/'. Make sure to have leading and trailing slashes." -msgstr "" -"Príklad: '/about/contact/'. Uistite sa, že máte vložené ako úvodné tak aj " -"záverečné lomítka." - -#: contrib/flatpages/models/flatpages.py:8 -msgid "title" -msgstr "názov" - -#: contrib/flatpages/models/flatpages.py:9 -msgid "content" -msgstr "obsah" - -#: contrib/flatpages/models/flatpages.py:10 -msgid "enable comments" -msgstr "povolené komentáre" - -#: contrib/flatpages/models/flatpages.py:11 -msgid "template name" -msgstr "meno predlohy" - -#: contrib/flatpages/models/flatpages.py:12 -msgid "" -"Example: 'flatpages/contact_page'. If this isn't provided, the system will " -"use 'flatpages/default'." -msgstr "" -"Príklad: 'flatpages/contact_page'. Ak sa toto nevykonalo, systém použije " -"'flatpages/default'." - -#: contrib/flatpages/models/flatpages.py:13 -msgid "registration required" -msgstr "musíte byť zaregistrovaný" - -#: contrib/flatpages/models/flatpages.py:13 -msgid "If this is checked, only logged-in users will be able to view the page." -msgstr "" -"Ak je toto označené, potom len prihlásený užívateľ môže vidieť túto stránku." - -#: contrib/flatpages/models/flatpages.py:17 -msgid "flat page" -msgstr "plochá stránka" - -#: contrib/flatpages/models/flatpages.py:18 -msgid "flat pages" -msgstr "ploché stránky" - #: utils/translation.py:350 msgid "DATE_FORMAT" msgstr "" @@ -1827,3 +1827,5 @@ msgid "" "Your Web browser doesn't appear to have cookies enabled. Cookies are " "required for logging in." msgstr "" +"Vyzerá, že váš web prehliadač nedovoľuje prístup ku cookies. Cookies sú " +" nevýhnutné aby ste sa mohli prilásiť." diff --git a/django/contrib/redirects/middleware.py b/django/contrib/redirects/middleware.py index 7e490d5a21..d284629786 100644 --- a/django/contrib/redirects/middleware.py +++ b/django/contrib/redirects/middleware.py @@ -21,7 +21,7 @@ class RedirectFallbackMiddleware: if r is not None: if r == '': return httpwrappers.HttpResponseGone() - return httpwrappers.HttpResponseRedirect(r.new_path) + return httpwrappers.HttpResponsePermanentRedirect(r.new_path) # No redirect was found. Return the response. return response diff --git a/django/core/cache.py b/django/core/cache.py index e68de59a55..1d0eb914ee 100644 --- a/django/core/cache.py +++ b/django/core/cache.py @@ -32,6 +32,9 @@ The CACHE_BACKEND setting is a quasi-URI; examples are: locmem:/// A more sophisticaed local memory cache; this is multi-process- and thread-safe. + dummy:/// Doesn't actually cache. For use in test + environments. + All caches may take arguments; these are given in query-string style. Valid arguments are: @@ -275,6 +278,29 @@ class _LocMemCache(_SimpleCache): finally: self._lock.writer_leaves() +############### +# Dummy cache # +############### + +class _DummyCache(_Cache): + def __init__(self, *args, **kwargs): + pass + + def get(self, *args, **kwargs): + pass + + def set(self, *args, **kwargs): + pass + + def delete(self, *args, **kwargs): + pass + + def get_many(self, *args, **kwargs): + pass + + def has_key(self, *args, **kwargs): + return False + #################### # File-based cache # #################### @@ -443,11 +469,12 @@ class _DBCache(_Cache): from cgi import parse_qsl _BACKENDS = { - 'memcached' : _MemcachedCache, - 'simple' : _SimpleCache, - 'locmem' : _LocMemCache, - 'file' : _FileCache, - 'db' : _DBCache, + 'memcached': _MemcachedCache, + 'simple': _SimpleCache, + 'locmem': _LocMemCache, + 'file': _FileCache, + 'db': _DBCache, + 'dummy': _DummyCache, } def get_cache(backend_uri): diff --git a/django/core/template/defaultfilters.py b/django/core/template/defaultfilters.py index d569cb1e42..73548c4afa 100644 --- a/django/core/template/defaultfilters.py +++ b/django/core/template/defaultfilters.py @@ -117,7 +117,8 @@ def urlize(value): def urlizetrunc(value, limit): """ - Converts URLs into clickable links, truncating URLs to the given character limit + Converts URLs into clickable links, truncating URLs to the given character limit, + and adding 'rel=nofollow' attribute to discourage spamming. Argument: Length to truncate URLs to. """ @@ -254,7 +255,14 @@ def slice_(value, arg): for an introduction. """ try: - return value[slice(*[x and int(x) or None for x in arg.split(':')])] + bits = [] + for x in arg.split(':'): + if len(x) == 0: + bits.append(None) + else: + bits.append(int(x)) + return value[slice(*bits)] + except (ValueError, TypeError): return value # Fail silently. diff --git a/django/middleware/common.py b/django/middleware/common.py index 7ab2841118..aa8f4ec071 100644 --- a/django/middleware/common.py +++ b/django/middleware/common.py @@ -46,7 +46,7 @@ class CommonMiddleware: newurl = new_url[1] if request.GET: newurl += '?' + request.GET.urlencode() - return httpwrappers.HttpResponseRedirect(newurl) + return httpwrappers.HttpResponsePermanentRedirect(newurl) return None diff --git a/django/utils/httpwrappers.py b/django/utils/httpwrappers.py index 6a64592eaa..6fda8ad570 100644 --- a/django/utils/httpwrappers.py +++ b/django/utils/httpwrappers.py @@ -212,6 +212,12 @@ class HttpResponseRedirect(HttpResponse): self['Location'] = redirect_to self.status_code = 302 +class HttpResponsePermanentRedirect(HttpResponse): + def __init__(self, redirect_to): + HttpResponse.__init__(self) + self['Location'] = redirect_to + self.status_code = 301 + class HttpResponseNotModified(HttpResponse): def __init__(self): HttpResponse.__init__(self) diff --git a/django/utils/timesince.py b/django/utils/timesince.py index b9edb12554..0d1ab470e5 100644 --- a/django/utils/timesince.py +++ b/django/utils/timesince.py @@ -24,14 +24,16 @@ def timesince(d, now=None): else: tz = None now = datetime.datetime(t[0], t[1], t[2], t[3], t[4], t[5], tzinfo=tz) - delta = now - d + + # ignore microsecond part of 'd' since we removed it from 'now' + delta = now - (d - datetime.timedelta(0, 0, d.microsecond)) since = delta.days * 24 * 60 * 60 + delta.seconds for i, (seconds, name) in enumerate(chunks): count = since / seconds if count != 0: break if count < 0: - return '%d milliseconds' % math.floor(delta.microseconds / 1000) + return '%d milliseconds' % math.floor((now - d).microseconds / 1000) s = '%d %s' % (count, name(count)) if i + 1 < len(chunks): # Now get the second item diff --git a/django/views/generic/simple.py b/django/views/generic/simple.py index 8a054e1ce7..086ed42805 100644 --- a/django/views/generic/simple.py +++ b/django/views/generic/simple.py @@ -1,28 +1,28 @@ from django.core.extensions import DjangoContext, render_to_response -from django.utils.httpwrappers import HttpResponse, HttpResponseRedirect, HttpResponseGone +from django.utils.httpwrappers import HttpResponse, HttpResponsePermanentRedirect, HttpResponseGone def direct_to_template(request, template, **kwargs): """ - Render a given template with any extra URL parameters in the context as + Render a given template with any extra URL parameters in the context as ``{{ params }}``. """ return render_to_response(template, {'params' : kwargs}, context_instance=DjangoContext(request)) - + def redirect_to(request, url, **kwargs): """ - Redirect to a given URL. - - The given url may contain dict-style string formatting which will be + Redirect to a given URL. + + The given url may contain dict-style string formatting, which will be interpolated against the params in the URL. For example, to redirect from - ``/foo//`` to ``/bar//``, you could use the following urlpattern:: + ``/foo//`` to ``/bar//``, you could use the following URLconf:: urlpatterns = patterns('', ('^foo/(?p\d+)/$', 'django.views.generic.simple.redirect_to', {'url' : '/bar/%(id)s/'}), ) - + If the given url is ``None``, a HttpResponseGone (410) will be issued. """ if url is not None: - return HttpResponseRedirect(url % kwargs) + return HttpResponsePermanentRedirect(url % kwargs) else: - return HttpResponseGone() \ No newline at end of file + return HttpResponseGone() diff --git a/docs/cache.txt b/docs/cache.txt index 8f81514e66..09e201a202 100644 --- a/docs/cache.txt +++ b/docs/cache.txt @@ -47,6 +47,12 @@ Examples: locmem:/// A more sophisticated local memory cache; this is multi-process- and thread-safe. + + dummy:/// **New in Django development version.** + Doesn't actually cache; just implements the + cache backend interface and doesn't do + anything. This is an easy way to turn off + caching for a test environment. ============================== =========================================== All caches may take arguments -- they're given in query-string style. Valid diff --git a/docs/request_response.txt b/docs/request_response.txt index dea1cdb975..76882953bb 100644 --- a/docs/request_response.txt +++ b/docs/request_response.txt @@ -357,7 +357,14 @@ types of HTTP responses. Like ``HttpResponse``, these subclasses live in ``HttpResponseRedirect`` The constructor takes a single argument -- the path to redirect to. This can be a fully qualified URL (e.g. ``"http://www.yahoo.com/search/"``) or an - absolute URL with no domain (e.g. ``"/search/"``). + absolute URL with no domain (e.g. ``"/search/"``). Note that this returns + an HTTP status code 302. + +``HttpResponsePermanentRedirect`` + **New in Django development version.*** + + Like ``HttpResponseRedirect``, but it returns a permanent redirect (HTTP + status code 301) instead of a "found" redirect (status code 302). ``HttpResponseNotModified`` The constructor doesn't take any arguments. Use this to designate that a diff --git a/docs/url_dispatch.txt b/docs/url_dispatch.txt index 55a154396c..449f26f442 100644 --- a/docs/url_dispatch.txt +++ b/docs/url_dispatch.txt @@ -328,7 +328,7 @@ the following example is valid:: ) # In foo/urls/blog.py - urlpatterns = patterns('foo.views' + urlpatterns = patterns('foo.views', (r'^$', 'blog.index'), (r'^archive/$', 'blog.archive'), ) diff --git a/tests/othertests/defaultfilters.py b/tests/othertests/defaultfilters.py index 539994ba84..d0d5d21e58 100644 --- a/tests/othertests/defaultfilters.py +++ b/tests/othertests/defaultfilters.py @@ -11,9 +11,319 @@ '0.0' >>> floatformat(0.0) '0' + +>>> addslashes('"double quotes" and \\'single quotes\\'') +'\\\\"double quotes\\\\" and \\\\\\'single quotes\\\\\\'' + +>>> capfirst('hello world') +'Hello world' + +>>> fix_ampersands('Jack & Jill & Jeroboam') +'Jack & Jill & Jeroboam' + +>>> linenumbers('line 1\\nline 2') +'1. line 1\\n2. line 2' + +>>> linenumbers('\\n'.join(['x'] * 10)) +'01. x\\n02. x\\n03. x\\n04. x\\n05. x\\n06. x\\n07. x\\n08. x\\n09. x\\n10. x' + +>>> lower('TEST') +'test' + +>>> lower(u'\\xcb') # uppercase E umlaut +u'\\xeb' + +>>> make_list('abc') +['a', 'b', 'c'] + +>>> make_list(1234) +['1', '2', '3', '4'] + +>>> slugify(' Jack & Jill like numbers 1,2,3 and 4 and silly characters ?%.$!/') +'jack-jill-like-numbers-123-and-4-and-silly-characters' + +>>> stringformat(1, '03d') +'001' + +>>> stringformat(1, 'z') +'' + +>>> title('a nice title, isn\\'t it?') +"A Nice Title, Isn't It?" + + +>>> truncatewords('A sentence with a few words in it', 1) +'A ...' + +>>> truncatewords('A sentence with a few words in it', 5) +'A sentence with a few ...' + +>>> truncatewords('A sentence with a few words in it', 100) +'A sentence with a few words in it' + +>>> truncatewords('A sentence with a few words in it', 'not a number') +'A sentence with a few words in it' + + +>>> upper('Mixed case input') +'MIXED CASE INPUT' + +>>> upper(u'\\xeb') # lowercase e umlaut +u'\\xcb' + + +>>> urlencode('jack & jill') +'jack%20%26%20jill' + + +>>> urlizetrunc('http://short.com/', 20) +'http://short.com/' + +>>> urlizetrunc('http://www.google.co.uk/search?hl=en&q=some+long+url&btnG=Search&meta=', 20) +'http://www.google.co...' + +>>> wordcount('') +0 + +>>> wordcount('oneword') +1 + +>>> wordcount('lots of words') +3 + +>>> wordwrap('this is a long paragraph of text that really needs to be wrapped I\\'m afraid', 14) +"this is a long\\nparagraph of\\ntext that\\nreally needs\\nto be wrapped\\nI'm afraid" + +>>> ljust('test', 10) +'test ' + +>>> ljust('test', 3) +'test' + +>>> rjust('test', 10) +' test' + +>>> rjust('test', 3) +'test' + +>>> center('test', 6) +' test ' + +>>> cut('a string to be mangled', 'a') +' string to be mngled' + +>>> cut('a string to be mangled', 'ng') +'a stri to be maled' + +>>> cut('a string to be mangled', 'strings') +'a string to be mangled' + +>>> escape(' here') +'<some html & special characters > here' + +>>> linebreaks('line 1') +'

line 1

' + +>>> linebreaks('line 1\\nline 2') +'

line 1
line 2

' + +>>> removetags('some html with disallowed tags', 'script img') +'some html with alert("You smell") disallowed tags' + +>>> striptags('some html with disallowed tags') +'some html with alert("You smell") disallowed tags' + +>>> dictsort([{'age': 23, 'name': 'Barbara-Ann'},\ + {'age': 63, 'name': 'Ra Ra Rasputin'},\ + {'name': 'Jonny B Goode', 'age': 18}], 'age') +[{'age': 18, 'name': 'Jonny B Goode'},\ + {'age': 23, 'name': 'Barbara-Ann'},\ + {'age': 63, 'name': 'Ra Ra Rasputin'}] + +>>> dictsortreversed([{'age': 23, 'name': 'Barbara-Ann'},\ + {'age': 63, 'name': 'Ra Ra Rasputin'},\ + {'name': 'Jonny B Goode', 'age': 18}], 'age') +[{'age': 63, 'name': 'Ra Ra Rasputin'},\ + {'age': 23, 'name': 'Barbara-Ann'},\ + {'age': 18, 'name': 'Jonny B Goode'}] + +>>> first([0,1,2]) +0 + +>>> first('') +'' + +>>> first('test') +'t' + +>>> join([0,1,2], 'glue') +'0glue1glue2' + +>>> length('1234') +4 + +>>> length([1,2,3,4]) +4 + +>>> length_is([], 0) +True + +>>> length_is([], 1) +False + +>>> length_is('a', 1) +True + +>>> length_is('a', 10) +False + +>>> slice_('abcdefg', '0') +'' + +>>> slice_('abcdefg', '1') +'a' + +>>> slice_('abcdefg', '-1') +'abcdef' + +>>> slice_('abcdefg', '1:2') +'b' + +>>> slice_('abcdefg', '1:3') +'bc' + +>>> slice_('abcdefg', '0::2') +'aceg' + +>>> unordered_list(['item 1', []]) +'\\t
  • item 1
  • ' + +>>> unordered_list(['item 1', [['item 1.1', []]]]) +'\\t
  • item 1\\n\\t
      \\n\\t\\t
    • item 1.1
    • \\n\\t
    \\n\\t
  • ' + +>>> unordered_list(['item 1', [['item 1.1', []], ['item 1.2', []]]]) +'\\t
  • item 1\\n\\t
      \\n\\t\\t
    • item 1.1
    • \\n\\t\\t
    • item 1.2
    • \\n\\t
    \\n\\t
  • ' + +>>> add('1', '2') +3 + +>>> get_digit(123, 1) +3 + +>>> get_digit(123, 2) +2 + +>>> get_digit(123, 3) +1 + +>>> get_digit(123, 4) +0 + +>>> get_digit(123, 0) +123 + +>>> get_digit('xyz', 0) +'xyz' + +# real testing of date() is in dateformat.py +>>> date(datetime.datetime(2005, 12, 29), "d F Y") +'29 December 2005' + +# real testing of time() is done in dateformat.py +>>> time(datetime.time(13), "h") +'01' + +# real testing is done in timesince.py, where we can provide our own 'now' +>>> timesince(datetime.datetime.now() - datetime.timedelta(1)) +'1 day' + +>>> default("val", "default") +'val' + +>>> default(None, "default") +'default' + +>>> default('', "default") +'default' + +>>> default_if_none("val", "default") +'val' + +>>> default_if_none(None, "default") +'default' + +>>> default_if_none('', "default") +'' + +>>> divisibleby(4, 2) +True + +>>> divisibleby(4, 3) +False + +>>> yesno(True) +'yes' + +>>> yesno(False) +'no' + +>>> yesno(None) +'maybe' + +>>> yesno(True, 'certainly,get out of town,perhaps') +'certainly' + +>>> yesno(False, 'certainly,get out of town,perhaps') +'get out of town' + +>>> yesno(None, 'certainly,get out of town,perhaps') +'perhaps' + +>>> yesno(None, 'certainly,get out of town') +'get out of town' + +>>> filesizeformat(1023) +'1023 bytes' + +>>> filesizeformat(1024) +'1.0 KB' + +>>> filesizeformat(10*1024) +'10.0 KB' + +>>> filesizeformat(1024*1024-1) +'1024.0 KB' + +>>> filesizeformat(1024*1024) +'1.0 MB' + +>>> filesizeformat(1024*1024*50) +'50.0 MB' + +>>> filesizeformat(1024*1024*1024-1) +'1024.0 MB' + +>>> filesizeformat(1024*1024*1024) +'1.0 GB' + +>>> pluralize(1) +'' + +>>> pluralize(0) +'s' + +>>> pluralize(2) +'s' + +>>> phone2numeric('0800 flowers') +'0800 3569377' + + + """ from django.core.template.defaultfilters import * +import datetime if __name__ == '__main__': import doctest diff --git a/tests/runtests.py b/tests/runtests.py index ae5091b345..c03c2a76fb 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -208,7 +208,7 @@ if __name__ == "__main__": parser.add_option('-v', help='How verbose should the output be? Choices are 0, 1 and 2, where 2 is most verbose. Default is 0.', type='choice', choices=['0', '1', '2']) parser.add_option('--settings', - help='Python path to settings module, e.g. "myproject.settings.main". If this isn\'t provided, the DJANGO_SETTINGS_MODULE environment variable will be used.') + help='Python path to settings module, e.g. "myproject.settings". If this isn\'t provided, the DJANGO_SETTINGS_MODULE environment variable will be used.') options, args = parser.parse_args() verbosity_level = 0 if options.v: