Django

Code

Changeset 5601

Show
Ignore:
Timestamp:
07/04/07 01:02:00 (1 year ago)
Author:
mtredinnick
Message:

unicode: Merged from trunk up to [5600].

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/unicode

    • Property svnmerge-integrated changed from /django/trunk:1-5579 to /django/trunk:1-5600
  • django/branches/unicode/AUTHORS

    r5580 r5601  
    238238    torne-django@wolfpuppy.org.uk 
    239239    Karen Tracey <graybark@bellsouth.net> 
     240    tstromberg@google.com 
    240241    Makoto Tsuyuki <mtsuyuki@gmail.com> 
    241242    tt@gurgle.no 
  • django/branches/unicode/django/contrib/sessions/middleware.py

    r5310 r5601  
    3838 
    3939    def pop(self, key, *args): 
     40        self.modified = self.modified or key in self._session  
    4041        return self._session.pop(key, *args) 
    4142 
  • django/branches/unicode/django/contrib/sessions/tests.py

    r5310 r5601  
    66>>> s._session_cache['some key'] = 'exists' 
    77 
     8>>> s.accessed 
     9False 
     10>>> s.modified 
     11False 
     12 
     13>>> s.pop('non existant key', 'does not exist') 
     14'does not exist' 
     15>>> s.accessed 
     16True 
     17>>> s.modified 
     18False 
     19 
    820>>> s.pop('some key') 
    921'exists' 
     22>>> s.accessed 
     23True 
     24>>> s.modified 
     25True 
    1026 
    1127>>> s.pop('some key', 'does not exist') 
  • django/branches/unicode/django/core/management.py

    r5531 r5601  
    833833        sys.exit(1) 
    834834    _start_helper('project', project_name, directory) 
     835 
    835836    # Create a random SECRET_KEY hash, and put it in the main settings. 
    836837    main_settings_file = os.path.join(directory, project_name, 'settings.py') 
    837838    settings_contents = open(main_settings_file, 'r').read() 
     839 
     840    # If settings.py was copied from a read-only source, make it writeable. 
     841    if not os.access(main_settings_file, os.W_OK): 
     842        os.chmod(main_settings_file, 0600) 
     843 
    838844    fp = open(main_settings_file, 'w') 
    839845    secret_key = ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)]) 
  • django/branches/unicode/django/views/defaults.py

    r4612 r5601  
    2222 
    2323    # If the object actually defines a domain, we're done. 
    24     if absurl.startswith('http://')
     24    if absurl.startswith('http://') or absurl.startswith('https://')
    2525        return http.HttpResponseRedirect(absurl) 
    2626 
     
    6262    # to whatever get_absolute_url() returned. 
    6363    if object_domain is not None: 
    64         return http.HttpResponseRedirect('http://%s%s' % (object_domain, absurl)) 
     64        protocol = request.is_secure() and 'https' or 'http' 
     65        return http.HttpResponseRedirect('%s://%s%s' % (protocol, object_domain, absurl)) 
    6566    else: 
    6667        return http.HttpResponseRedirect(absurl) 
  • django/branches/unicode/docs/contributing.txt

    r5580 r5601  
    395395These guidelines regulate the format of our ReST documentation: 
    396396 
    397        * In section titles, capitalize only initial words and proper nouns. 
    398  
    399        * Wrap the documentation at 80 characters wide, unless a code example 
    400          is significantly less readable when split over two lines, or for another 
    401          good reason. 
     397    * In section titles, capitalize only initial words and proper nouns. 
     398 
     399    * Wrap the documentation at 80 characters wide, unless a code example 
     400      is significantly less readable when split over two lines, or for another 
     401      good reason. 
    402402 
    403403Commonly used terms 
     
    407407documentation: 
    408408 
    409        * **Django** -- when referring to the framework, capitalize Django. It is 
    410          lowercase only in Python code and in the djangoproject.com logo. 
    411  
    412        * **e-mail** -- it has a hyphen. 
    413  
    414        * **MySQL** 
    415  
    416        * **PostgreSQL** 
    417  
    418        * **Python** -- when referring to the language, capitalize Python. 
    419  
    420        * **realize**, **customize**, **initialize**, etc. -- use the American 
    421          "ize" suffix, not "ise." 
    422  
    423        * **SQLite** 
    424  
    425        * **subclass** -- it's a single word without a hyphen, both as a verb 
    426          ("subclass that model") and as a noun ("create a subclass"). 
    427  
    428        * **Web**, **World Wide Web**, **the Web** -- note Web is always 
    429          capitalized when referring to the World Wide Web. 
     409    * **Django** -- when referring to the framework, capitalize Django. It is 
     410      lowercase only in Python code and in the djangoproject.com logo. 
     411 
     412    * **e-mail** -- it has a hyphen. 
     413 
     414    * **MySQL** 
     415 
     416    * **PostgreSQL** 
     417 
     418    * **Python** -- when referring to the language, capitalize Python. 
     419 
     420    * **realize**, **customize**, **initialize**, etc. -- use the American 
     421      "ize" suffix, not "ise." 
     422 
     423    * **SQLite** 
     424 
     425    * **subclass** -- it's a single word without a hyphen, both as a verb 
     426      ("subclass that model") and as a noun ("create a subclass"). 
     427 
     428    * **Web**, **World Wide Web**, **the Web** -- note Web is always 
     429      capitalized when referring to the World Wide Web. 
    430430 
    431431    * **Web site** -- use two words, with Web capitalized. 
     
    434434--------------------------- 
    435435 
    436        * **model** -- it's not capitalized. 
    437  
    438        * **template** -- it's not capitalized. 
    439  
    440        * **URLconf** -- use three capitalized letters, with no space before 
    441          "conf." 
    442  
    443        * **view** -- it's not capitalized. 
     436    * **model** -- it's not capitalized. 
     437 
     438    * **template** -- it's not capitalized. 
     439 
     440    * **URLconf** -- use three capitalized letters, with no space before 
     441      "conf." 
     442 
     443    * **view** -- it's not capitalized. 
    444444 
    445445Committing code 
  • django/branches/unicode/docs/templates_python.txt

    r5580 r5601  
    312312    def some_view(request): 
    313313        # ... 
    314         return RequestContext(request, { 
     314        c = RequestContext(request, { 
    315315            'foo': 'bar', 
    316316        }, [ip_address_processor]) 
     317        return t.render(c) 
    317318 
    318319Note:: 
     
    678679    @template.stringfilter 
    679680    def lower(value): 
    680        return value.lower() 
     681        return value.lower() 
    681682 
    682683Writing custom template tags