mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
boulder-oracle-sprint: Merged to [5193]
git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@5194 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
12702bc683
commit
bcc26d8eea
Binary file not shown.
@ -1344,7 +1344,7 @@ msgstr "四月"
|
|||||||
|
|
||||||
#: utils/dates.py:19
|
#: utils/dates.py:19
|
||||||
msgid "may"
|
msgid "may"
|
||||||
msgstr "三月"
|
msgstr "五月"
|
||||||
|
|
||||||
#: utils/dates.py:19
|
#: utils/dates.py:19
|
||||||
msgid "jun"
|
msgid "jun"
|
||||||
|
Binary file not shown.
@ -46,7 +46,7 @@ msgstr "清除全部"
|
|||||||
#: contrib/admin/media/js/dateparse.js:32
|
#: contrib/admin/media/js/dateparse.js:32
|
||||||
#: contrib/admin/media/js/calendar.js:24
|
#: contrib/admin/media/js/calendar.js:24
|
||||||
msgid "January February March April May June July August September October November December"
|
msgid "January February March April May June July August September October November December"
|
||||||
msgstr "一月 二月 三月 四月 五月 六月 六月 七月 八月 九月 十月 十一月 十二月"
|
msgstr "一月 二月 三月 四月 五月 六月 七月 八月 九月 十月 十一月 十二月"
|
||||||
|
|
||||||
#: contrib/admin/media/js/dateparse.js:33
|
#: contrib/admin/media/js/dateparse.js:33
|
||||||
msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday"
|
msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday"
|
||||||
|
@ -59,8 +59,11 @@ def words(count, common=True):
|
|||||||
word_list = []
|
word_list = []
|
||||||
c = len(word_list)
|
c = len(word_list)
|
||||||
if count > c:
|
if count > c:
|
||||||
count = min(count - c, len(WORDS))
|
count -= c
|
||||||
word_list += random.sample(WORDS, count - c)
|
while count > 0:
|
||||||
|
c = min(count, len(WORDS))
|
||||||
|
count -= c
|
||||||
|
word_list += random.sample(WORDS, c)
|
||||||
else:
|
else:
|
||||||
word_list = word_list[:count]
|
word_list = word_list[:count]
|
||||||
return ' '.join(word_list)
|
return ' '.join(word_list)
|
||||||
|
@ -91,6 +91,10 @@ class QueryDict(MultiValueDict):
|
|||||||
self._assert_mutable()
|
self._assert_mutable()
|
||||||
MultiValueDict.__setitem__(self, key, value)
|
MultiValueDict.__setitem__(self, key, value)
|
||||||
|
|
||||||
|
def __delitem__(self, key):
|
||||||
|
self._assert_mutable()
|
||||||
|
super(QueryDict, self).__delitem__(key)
|
||||||
|
|
||||||
def __copy__(self):
|
def __copy__(self):
|
||||||
result = self.__class__('', mutable=True)
|
result = self.__class__('', mutable=True)
|
||||||
for key, value in dict.items(self):
|
for key, value in dict.items(self):
|
||||||
|
@ -86,7 +86,7 @@ If you installed Django using ``setup.py install``, uninstalling
|
|||||||
is as simple as deleting the ``django`` directory from your Python
|
is as simple as deleting the ``django`` directory from your Python
|
||||||
``site-packages``.
|
``site-packages``.
|
||||||
|
|
||||||
If you installed Django from a Python Egg, remove the Django ``.egg` file,
|
If you installed Django from a Python Egg, remove the Django ``.egg`` file,
|
||||||
and remove the reference to the egg in the file named ``easy-install.pth``.
|
and remove the reference to the egg in the file named ``easy-install.pth``.
|
||||||
This file should also be located in your ``site-packages`` directory.
|
This file should also be located in your ``site-packages`` directory.
|
||||||
|
|
||||||
|
@ -717,7 +717,7 @@ object::
|
|||||||
# split_contents() knows not to split quoted strings.
|
# split_contents() knows not to split quoted strings.
|
||||||
tag_name, format_string = token.split_contents()
|
tag_name, format_string = token.split_contents()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise template.TemplateSyntaxError, "%r tag requires a single argument" % token.contents[0]
|
raise template.TemplateSyntaxError, "%r tag requires a single argument" % token.contents.split()[0]
|
||||||
if not (format_string[0] == format_string[-1] and format_string[0] in ('"', "'")):
|
if not (format_string[0] == format_string[-1] and format_string[0] in ('"', "'")):
|
||||||
raise template.TemplateSyntaxError, "%r tag's argument should be in quotes" % tag_name
|
raise template.TemplateSyntaxError, "%r tag's argument should be in quotes" % tag_name
|
||||||
return CurrentTimeNode(format_string[1:-1])
|
return CurrentTimeNode(format_string[1:-1])
|
||||||
@ -846,7 +846,7 @@ Now your tag should begin to look like this::
|
|||||||
# split_contents() knows not to split quoted strings.
|
# split_contents() knows not to split quoted strings.
|
||||||
tag_name, date_to_be_formatted, format_string = token.split_contents()
|
tag_name, date_to_be_formatted, format_string = token.split_contents()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise template.TemplateSyntaxError, "%r tag requires exactly two arguments" % token.contents[0]
|
raise template.TemplateSyntaxError, "%r tag requires exactly two arguments" % token.contents.split()[0]
|
||||||
if not (format_string[0] == format_string[-1] and format_string[0] in ('"', "'")):
|
if not (format_string[0] == format_string[-1] and format_string[0] in ('"', "'")):
|
||||||
raise template.TemplateSyntaxError, "%r tag's argument should be in quotes" % tag_name
|
raise template.TemplateSyntaxError, "%r tag's argument should be in quotes" % tag_name
|
||||||
return FormatTimeNode(date_to_be_formatted, format_string[1:-1])
|
return FormatTimeNode(date_to_be_formatted, format_string[1:-1])
|
||||||
@ -1080,7 +1080,7 @@ class, like so::
|
|||||||
# Splitting by None == splitting by spaces.
|
# Splitting by None == splitting by spaces.
|
||||||
tag_name, arg = token.contents.split(None, 1)
|
tag_name, arg = token.contents.split(None, 1)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise template.TemplateSyntaxError, "%r tag requires arguments" % token.contents[0]
|
raise template.TemplateSyntaxError, "%r tag requires arguments" % token.contents.split()[0]
|
||||||
m = re.search(r'(.*?) as (\w+)', arg)
|
m = re.search(r'(.*?) as (\w+)', arg)
|
||||||
if not m:
|
if not m:
|
||||||
raise template.TemplateSyntaxError, "%r tag had invalid arguments" % tag_name
|
raise template.TemplateSyntaxError, "%r tag had invalid arguments" % tag_name
|
||||||
|
@ -96,6 +96,12 @@ MultiValueDictKeyError: "Key 'foo' not found in <MultiValueDict: {}>"
|
|||||||
>>> q['name']
|
>>> q['name']
|
||||||
'john'
|
'john'
|
||||||
|
|
||||||
|
>>> del q['name']
|
||||||
|
>>> 'name' in q
|
||||||
|
False
|
||||||
|
|
||||||
|
>>> q['name'] = 'john'
|
||||||
|
|
||||||
>>> q.get('foo', 'default')
|
>>> q.get('foo', 'default')
|
||||||
'default'
|
'default'
|
||||||
|
|
||||||
@ -367,6 +373,11 @@ AttributeError: This QueryDict instance is immutable
|
|||||||
>>> q.urlencode()
|
>>> q.urlencode()
|
||||||
'vote=yes&vote=no'
|
'vote=yes&vote=no'
|
||||||
|
|
||||||
|
>>> del q['vote']
|
||||||
|
Traceback (most recent call last):
|
||||||
|
...
|
||||||
|
AttributeError: This QueryDict instance is immutable
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from django.http import QueryDict
|
from django.http import QueryDict
|
||||||
|
Loading…
x
Reference in New Issue
Block a user