Django

Code

Changeset 910

Show
Ignore:
Timestamp:
10/17/05 10:44:09 (3 years ago)
Author:
hugo
Message:

i18n: merged to [905] from trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/i18n/django/views/defaults.py

    r869 r910  
    1111    except ObjectDoesNotExist: 
    1212        raise Http404, "Content type %s object %s doesn't exist" % (content_type_id, object_id) 
    13     if not hasattr(obj, 'get_absolute_url'): 
     13    try: 
     14        absurl = obj.get_absolute_url() 
     15    except AttributeError: 
    1416        raise Http404, "%s objects don't have get_absolute_url() methods" % content_type.name 
     17    if absurl.startswith('http://'): 
     18        return httpwrappers.HttpResponseRedirect(absurl) 
    1519    object_domain = None 
    1620    if hasattr(obj, 'get_site_list'): 
     
    2832        pass 
    2933    if not object_domain: 
    30         return httpwrappers.HttpResponseRedirect(obj.get_absolute_url()
    31     return httpwrappers.HttpResponseRedirect('http://%s%s' % (object_domain, obj.get_absolute_url())) 
     34        return httpwrappers.HttpResponseRedirect(absurl
     35    return httpwrappers.HttpResponseRedirect('http://%s%s' % (object_domain, absurl)) 
    3236 
    3337def page_not_found(request): 
  • django/branches/i18n/docs/django-admin.txt

    r815 r910  
    113113Just execute ``django-admin.py runserver`` more than once. 
    114114 
     115Note that the default IP address, 127.0.0.1, is not accessible from other 
     116machines on your network. To make your development server viewable to other 
     117machines on the network, use its own IP address (e.g. ``192.168.2.1``) or 
     118``0.0.0.0``. 
     119 
    115120Examples: 
    116121~~~~~~~~~ 
  • django/branches/i18n/docs/settings.txt

    r899 r910  
    401401Whether to prepend the "www." subdomain to URLs that don't have it. This is 
    402402only used if ``CommonMiddleware`` is installed (see the `middleware docs`_). 
    403 See also ``PREPEND_WWW``. 
     403See also ``APPEND_SLASH``. 
    404404 
    405405SECRET_KEY 
  • django/branches/i18n/docs/templates.txt

    r869 r910  
    224224      if you want to add to the contents of a parent block instead of 
    225225      completely overriding it. 
     226 
     227Finally, note that you can't define multiple ``{% block %}`` tags with the same 
     228name in the same template. This limitation exists because a block tag works in 
     229"both" directions. That is, a block tag doesn't just provide a hole to fill -- 
     230it also defines the content that fills the hole in the *parent*. If there were 
     231two similarly-named ``{% block %}`` tags in a template, that template's parent 
     232wouldn't know which one of the blocks' content to use. 
    226233 
    227234Using the built-in reference