Author: mtredinnick
Date: 2007-07-04 01:02:00 -0500 (Wed, 04 Jul 2007)
New Revision: 5601
Modified:
django/branches/unicode/
django/branches/unicode/AUTHORS
django/branches/unicode/django/contrib/sessions/middleware.py
django/branches/unicode/django/contrib/sessions/tests.py
django/branches/unicode/django/core/management.py
django/branches/unicode/django/views/defaults.py
django/branches/unicode/docs/contributing.txt
django/branches/unicode/docs/templates_python.txt
Log:
unicode: Merged from trunk up to [5600].
Property changes on: django/branches/unicode
___________________________________________________________________
Name: svnmerge-integrated
- /django/trunk:1-5579
+ /django/trunk:1-5600
Modified: django/branches/unicode/AUTHORS
===================================================================
--- django/branches/unicode/AUTHORS 2007-07-03 19:26:34 UTC (rev 5600)
+++ django/branches/unicode/AUTHORS 2007-07-04 06:02:00 UTC (rev 5601)
@@ -237,6 +237,7 @@
Joe Topjian <http://joe.terrarum.net/geek/code/python/django/>
[EMAIL PROTECTED]
Karen Tracey <[EMAIL PROTECTED]>
+ [EMAIL PROTECTED]
Makoto Tsuyuki <[EMAIL PROTECTED]>
[EMAIL PROTECTED]
Amit Upadhyay
Modified: django/branches/unicode/django/contrib/sessions/middleware.py
===================================================================
--- django/branches/unicode/django/contrib/sessions/middleware.py
2007-07-03 19:26:34 UTC (rev 5600)
+++ django/branches/unicode/django/contrib/sessions/middleware.py
2007-07-04 06:02:00 UTC (rev 5601)
@@ -37,6 +37,7 @@
return self._session.get(key, default)
def pop(self, key, *args):
+ self.modified = self.modified or key in self._session
return self._session.pop(key, *args)
def set_test_cookie(self):
Modified: django/branches/unicode/django/contrib/sessions/tests.py
===================================================================
--- django/branches/unicode/django/contrib/sessions/tests.py 2007-07-03
19:26:34 UTC (rev 5600)
+++ django/branches/unicode/django/contrib/sessions/tests.py 2007-07-04
06:02:00 UTC (rev 5601)
@@ -5,8 +5,24 @@
>>> s._session_cache = {}
>>> s._session_cache['some key'] = 'exists'
+>>> s.accessed
+False
+>>> s.modified
+False
+
+>>> s.pop('non existant key', 'does not exist')
+'does not exist'
+>>> s.accessed
+True
+>>> s.modified
+False
+
>>> s.pop('some key')
'exists'
+>>> s.accessed
+True
+>>> s.modified
+True
>>> s.pop('some key', 'does not exist')
'does not exist'
Modified: django/branches/unicode/django/core/management.py
===================================================================
--- django/branches/unicode/django/core/management.py 2007-07-03 19:26:34 UTC
(rev 5600)
+++ django/branches/unicode/django/core/management.py 2007-07-04 06:02:00 UTC
(rev 5601)
@@ -832,9 +832,15 @@
sys.stderr.write(style.ERROR("Error: '%r' conflicts with the name of
an existing Python module and cannot be used as a project name. Please try
another name.\n" % project_name))
sys.exit(1)
_start_helper('project', project_name, directory)
+
# Create a random SECRET_KEY hash, and put it in the main settings.
main_settings_file = os.path.join(directory, project_name, 'settings.py')
settings_contents = open(main_settings_file, 'r').read()
+
+ # If settings.py was copied from a read-only source, make it writeable.
+ if not os.access(main_settings_file, os.W_OK):
+ os.chmod(main_settings_file, 0600)
+
fp = open(main_settings_file, 'w')
secret_key = ''.join([choice('[EMAIL PROTECTED]&*(-_=+)') for i in
range(50)])
settings_contents = re.sub(r"(?<=SECRET_KEY = ')'", secret_key + "'",
settings_contents)
Modified: django/branches/unicode/django/views/defaults.py
===================================================================
--- django/branches/unicode/django/views/defaults.py 2007-07-03 19:26:34 UTC
(rev 5600)
+++ django/branches/unicode/django/views/defaults.py 2007-07-04 06:02:00 UTC
(rev 5601)
@@ -21,7 +21,7 @@
# if necessary.
# If the object actually defines a domain, we're done.
- if absurl.startswith('http://'):
+ if absurl.startswith('http://') or absurl.startswith('https://'):
return http.HttpResponseRedirect(absurl)
object_domain = None
@@ -61,7 +61,8 @@
# If all that malarkey found an object domain, use it; otherwise fall back
# to whatever get_absolute_url() returned.
if object_domain is not None:
- return http.HttpResponseRedirect('http://%s%s' % (object_domain,
absurl))
+ protocol = request.is_secure() and 'https' or 'http'
+ return http.HttpResponseRedirect('%s://%s%s' % (protocol,
object_domain, absurl))
else:
return http.HttpResponseRedirect(absurl)
Modified: django/branches/unicode/docs/contributing.txt
===================================================================
--- django/branches/unicode/docs/contributing.txt 2007-07-03 19:26:34 UTC
(rev 5600)
+++ django/branches/unicode/docs/contributing.txt 2007-07-04 06:02:00 UTC
(rev 5601)
@@ -394,11 +394,11 @@
These guidelines regulate the format of our ReST documentation:
- * In section titles, capitalize only initial words and proper nouns.
+ * In section titles, capitalize only initial words and proper nouns.
- * Wrap the documentation at 80 characters wide, unless a code example
- is significantly less readable when split over two lines, or for
another
- good reason.
+ * Wrap the documentation at 80 characters wide, unless a code example
+ is significantly less readable when split over two lines, or for another
+ good reason.
Commonly used terms
-------------------
@@ -406,41 +406,41 @@
Here are some style guidelines on commonly used terms throughout the
documentation:
- * **Django** -- when referring to the framework, capitalize Django. It
is
- lowercase only in Python code and in the djangoproject.com logo.
+ * **Django** -- when referring to the framework, capitalize Django. It is
+ lowercase only in Python code and in the djangoproject.com logo.
- * **e-mail** -- it has a hyphen.
+ * **e-mail** -- it has a hyphen.
- * **MySQL**
+ * **MySQL**
- * **PostgreSQL**
+ * **PostgreSQL**
- * **Python** -- when referring to the language, capitalize Python.
+ * **Python** -- when referring to the language, capitalize Python.
- * **realize**, **customize**, **initialize**, etc. -- use the American
- "ize" suffix, not "ise."
+ * **realize**, **customize**, **initialize**, etc. -- use the American
+ "ize" suffix, not "ise."
- * **SQLite**
+ * **SQLite**
- * **subclass** -- it's a single word without a hyphen, both as a verb
- ("subclass that model") and as a noun ("create a subclass").
+ * **subclass** -- it's a single word without a hyphen, both as a verb
+ ("subclass that model") and as a noun ("create a subclass").
- * **Web**, **World Wide Web**, **the Web** -- note Web is always
- capitalized when referring to the World Wide Web.
+ * **Web**, **World Wide Web**, **the Web** -- note Web is always
+ capitalized when referring to the World Wide Web.
* **Web site** -- use two words, with Web capitalized.
Django-specific terminology
---------------------------
- * **model** -- it's not capitalized.
+ * **model** -- it's not capitalized.
- * **template** -- it's not capitalized.
+ * **template** -- it's not capitalized.
- * **URLconf** -- use three capitalized letters, with no space before
- "conf."
+ * **URLconf** -- use three capitalized letters, with no space before
+ "conf."
- * **view** -- it's not capitalized.
+ * **view** -- it's not capitalized.
Committing code
===============
Modified: django/branches/unicode/docs/templates_python.txt
===================================================================
--- django/branches/unicode/docs/templates_python.txt 2007-07-03 19:26:34 UTC
(rev 5600)
+++ django/branches/unicode/docs/templates_python.txt 2007-07-04 06:02:00 UTC
(rev 5601)
@@ -311,9 +311,10 @@
def some_view(request):
# ...
- return RequestContext(request, {
+ c = RequestContext(request, {
'foo': 'bar',
}, [ip_address_processor])
+ return t.render(c)
Note::
If you're using Django's ``render_to_response()`` shortcut to populate a
@@ -677,7 +678,7 @@
@template.stringfilter
def lower(value):
- return value.lower()
+ return value.lower()
Writing custom template tags
----------------------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---