Django

Code

Changeset 3724

Show
Ignore:
Timestamp:
09/05/06 10:51:14 (2 years ago)
Author:
rmunn
Message:

sqlalchemy: Merged revisions 3679 to 3723 from trunk.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/sqlalchemy/AUTHORS

    r3601 r3724  
    105105    Jason McBrayer <http://www.carcosa.net/jason/> 
    106106    michael.mcewan@gmail.com 
    107     mir@noris.de 
    108107    mmarshall 
    109108    Eric Moritz <http://eric.themoritzfamily.com/> 
     
    122121    Daniel Poelzleithner <http://poelzi.org/> 
    123122    J. Rademaker 
     123    Michael Radziej <mir@noris.de> 
    124124    Brian Ray <http://brianray.chipy.org/> 
    125125    rhettg@gmail.com 
     
    127127    Ivan Sagalaev (Maniac) <http://www.softwaremaniacs.org/> 
    128128    David Schein 
     129    Pete Shinners <pete@shinners.org> 
     130    SmileyChris <smileychris@gmail.com> 
    129131    sopel 
    130132    Thomas Steinacher <tom@eggdrop.ch> 
     
    139141    Geert Vanderkelen 
    140142    Milton Waddams 
     143    Dan Watson <http://theidioteque.net/> 
    141144    Rachel Willmer <http://www.willmer.com/kb/> 
    142145    wojtek 
  • django/branches/sqlalchemy/django/conf/global_settings.py

    r3660 r3724  
    302302########### 
    303303 
    304 TEST_RUNNER='django.test.simple.run_tests' 
     304# The name of the method to use to invoke the test suite 
     305TEST_RUNNER = 'django.test.simple.run_tests' 
     306 
     307# The name of the database to use for testing purposes. 
     308# If None, a name of 'test_' + DATABASE_NAME will be assumed 
     309TEST_DATABASE_NAME = None 
  • django/branches/sqlalchemy/django/contrib/admin/views/doc.py

    r3605 r3724  
    329329    views = [] 
    330330    for p in urlpatterns: 
    331         if hasattr(p, 'get_callback'): 
     331        if hasattr(p, '_get_callback'): 
    332332            try: 
    333                 views.append((p.get_callback(), base + p.regex.pattern)) 
     333                views.append((p._get_callback(), base + p.regex.pattern)) 
    334334            except ViewDoesNotExist: 
    335335                continue 
    336336        elif hasattr(p, '_get_url_patterns'): 
    337             views.extend(extract_views_from_urlpatterns(p.url_patterns, base + p.regex.pattern)) 
     337            try: 
     338                patterns = p.url_patterns 
     339            except ImportError: 
     340                continue 
     341            views.extend(extract_views_from_urlpatterns(patterns, base + p.regex.pattern)) 
    338342        else: 
    339343            raise TypeError, _("%s does not appear to be a urlpattern object") % p 
  • django/branches/sqlalchemy/django/contrib/auth/models.py

    r3376 r3724  
    3434    Permissions are set globally per type of object, not per specific object instance. It is possible to say "Mary may change news stories," but it's not currently possible to say "Mary may change news stories, but only the ones she created herself" or "Mary may only change news stories that have a certain status or publication date." 
    3535 
    36     Three basic permissions -- add, create and delete -- are automatically created for each Django model. 
     36    Three basic permissions -- add, change and delete -- are automatically created for each Django model. 
    3737    """ 
    3838    name = models.CharField(_('name'), maxlength=50) 
  • django/branches/sqlalchemy/django/core/serializers/base.py

    r3237 r3724  
    1212    """Something bad happened during serialization.""" 
    1313    pass 
    14      
     14 
    1515class DeserializationError(Exception): 
    1616    """Something bad happened during deserialization.""" 
     
    2121    Abstract serializer base class. 
    2222    """ 
    23      
     23 
    2424    def serialize(self, queryset, **options): 
    2525        """ 
     
    2727        """ 
    2828        self.options = options 
    29          
     29 
    3030        self.stream = options.get("stream", StringIO()) 
    31          
     31 
    3232        self.start_serialization() 
    3333        for obj in queryset: 
     
    4545        self.end_serialization() 
    4646        return self.getvalue() 
    47      
     47 
    4848    def get_string_value(self, obj, field): 
    4949        """ 
     
    5151        """ 
    5252        if isinstance(field, models.DateTimeField): 
    53             value = getattr(obj, field.name).strftime("%Y-%m-%d %H:%M:%S") 
     53            value = getattr(obj, field.name) 
     54            if value is None: 
     55                value = '' 
     56            else: 
     57                value = value.strftime("%Y-%m-%d %H:%M:%S") 
    5458        elif isinstance(field, models.FileField): 
    5559            value = getattr(obj, "get_%s_url" % field.name, lambda: None)() 
     
    5761            value = field.flatten_data(follow=None, obj=obj).get(field.name, "") 
    5862        return str(value) 
    59      
     63 
    6064    def start_serialization(self): 
    6165        """ 
     
    6367        """ 
    6468        raise NotImplementedError 
    65      
     69 
    6670    def end_serialization(self): 
    6771        """ 
     
    6973        """ 
    7074        pass 
    71      
     75 
    7276    def start_object(self, obj): 
    7377        """ 
     
    7579        """ 
    7680        raise NotImplementedError 
    77      
     81 
    7882    def end_object(self, obj): 
    7983        """ 
     
    8185        """ 
    8286        pass 
    83      
     87 
    8488    def handle_field(self, obj, field): 
    8589        """ 
     
    8791        """ 
    8892        raise NotImplementedError 
    89      
     93 
    9094    def handle_fk_field(self, obj, field): 
    9195        """ 
     
    9397        """ 
    9498        raise NotImplementedError 
    95      
     99 
    96100    def handle_m2m_field(self, obj, field): 
    97101        """ 
     
    99103        """ 
    100104        raise NotImplementedError 
    101      
     105 
    102106    def getvalue(self): 
    103107        """ 
     
    110114    Abstract base deserializer class. 
    111115    """ 
    112      
     116 
    113117    def __init__(self, stream_or_string, **options): 
    114118        """ 
     
    124128        # and friends might fail...) 
    125129        models.get_apps() 
    126      
     130 
    127131    def __iter__(self): 
    128132        return self 
    129      
     133 
    130134    def next(self): 
    131135        """Iteration iterface -- return the next item in the stream""" 
    132136        raise NotImplementedError 
    133          
     137 
    134138class DeserializedObject(object): 
    135139    """ 
    136140    A deserialzed model. 
    137      
     141 
    138142    Basically a container for holding the pre-saved deserialized data along 
    139143    with the many-to-many data saved with the object. 
    140      
     144 
    141145    Call ``save()`` to save the object (with the many-to-many data) to the 
    142146    database; call ``save(save_m2m=False)`` to save just the object fields 
    143147    (and not touch the many-to-many stuff.) 
    144148    """ 
    145      
     149 
    146150    def __init__(self, obj, m2m_data=None): 
    147151        self.object = obj 
    148152        self.m2m_data = m2m_data 
    149          
     153 
    150154    def __repr__(self): 
    151155        return "<DeserializedObject: %s>" % str(self.object) 
    152          
     156 
    153157    def save(self, save_m2m=True): 
    154158        self.object.save() 
     
    156160            for accessor_name, object_list in self.m2m_data.items(): 
    157161                setattr(self.object, accessor_name, object_list) 
    158          
    159         # prevent a second (possibly accidental) call to save() from saving  
     162 
     163        # prevent a second (possibly accidental) call to save() from saving 
    160164        # the m2m data twice. 
    161165        self.m2m_data = None 
  • django/branches/sqlalchemy/django/db/backends/sqlite3/base.py

    r3115 r3724  
    6363 
    6464    def close(self): 
    65         if self.connection is not None: 
     65        from django.conf import settings 
     66        # If database is in memory, closing the connection destroys the database. 
     67        # To prevent accidental data loss, ignore close requests on an in-memory db. 
     68        if self.connection is not None and settings.DATABASE_NAME != ":memory:": 
    6669            self.connection.close() 
    6770            self.connection = None 
  • django/branches/sqlalchemy/django/db/backends/util.py

    r3113 r3724  
    9999def _dict_helper(desc, row): 
    100100    "Returns a dictionary for the given cursor.description and result row." 
    101     return dict([(desc[col[0]][0], col[1]) for col in enumerate(row)]
     101    return dict(zip([col[0] for col in desc], row)
    102102 
    103103def dictfetchone(cursor): 
  • django/branches/sqlalchemy/django/template/defaulttags.py

    r3666 r3724  
    8787        context.push() 
    8888        try: 
    89             values = self.sequence.resolve(context
     89            values = self.sequence.resolve(context, True
    9090        except VariableDoesNotExist: 
    9191            values = [] 
     
    213213 
    214214    def render(self, context): 
    215         obj_list = self.target.resolve(context
    216         if obj_list == '': # target_var wasn't found in context; fail silently 
     215        obj_list = self.target.resolve(context, True
     216        if obj_list == None: # target_var wasn't found in context; fail silently 
    217217            context[self.var_name] = [] 
    218218            return '' 
    219219        output = [] # list of dictionaries in the format {'grouper': 'key', 'list': [list of contents]} 
    220220        for obj in obj_list: 
    221             grouper = self.expression.resolve(Context({'var': obj})
     221            grouper = self.expression.resolve(Context({'var': obj}), True
    222222            # TODO: Is this a sensible way to determine equality? 
    223223            if output and repr(output[-1]['grouper']) == repr(grouper): 
     
    252252        if self.parsed: 
    253253            try: 
    254                 t = Template(output
     254                t = Template(output, name=self.filepath
    255255                return t.render(context) 
    256256            except TemplateSyntaxError, e: 
  • django/branches/sqlalchemy/django/template/__init__.py

    r3666 r3724  
    138138 
    139139class Template(object): 
    140     def __init__(self, template_string, origin=None): 
     140    def __init__(self, template_string, origin=None, name='<Unknown Template>'): 
    141141        "Compilation stage" 
    142142        if settings.TEMPLATE_DEBUG and origin == None: 
     
    145145            # came from... 
    146146        self.nodelist = compile_string(template_string, origin) 
     147        self.name = name 
    147148 
    148149    def __iter__(self): 
     
    435436                i += 1 
    436437            if i >= len(subject): 
    437                 raise TemplateSyntaxError, "Searching for value. Unexpected end of string in column %d: %s" % subject 
     438                raise TemplateSyntaxError, "Searching for value. Unexpected end of string in column %d: %s" % (i, subject) 
    438439            i += 1 
    439440            res = subject[p:i] 
     
    549550        except VariableDoesNotExist: 
    550551            if ignore_failures: 
    551                 return None 
     552                obj = None 
    552553            else: 
    553                 return settings.TEMPLATE_STRING_IF_INVALID 
     554                if settings.TEMPLATE_STRING_IF_INVALID: 
     555                    return settings.TEMPLATE_STRING_IF_INVALID 
     556                else: 
     557                    obj = settings.TEMPLATE_STRING_IF_INVALID 
    554558        for func, args in self.filters: 
    555559            arg_vals = [] 
     
    615619    (The example assumes VARIABLE_ATTRIBUTE_SEPARATOR is '.') 
    616620    """ 
    617     if path == 'False': 
    618         current = False 
    619     elif path == 'True': 
    620         current = True 
    621     elif path[0].isdigit(): 
     621    if path[0].isdigit(): 
    622622        number_type = '.' in path and float or int 
    623623        try: 
  • django/branches/sqlalchemy/django/template/loader.py

    r3666 r3724  
    7777    handling template inheritance recursively. 
    7878    """ 
    79     return get_template_from_string(*find_template_source(template_name)) 
     79    source, origin = find_template_source(template_name) 
     80    template = get_template_from_string(source, origin, template_name) 
     81    return template 
    8082 
    81 def get_template_from_string(source, origin=None): 
     83def get_template_from_string(source, origin=None, name=None): 
    8284    """ 
    8385    Returns a compiled Template object for the given template code, 
    8486    handling template inheritance recursively. 
    8587    """ 
    86     return Template(source, origin
     88    return Template(source, origin, name
    8789 
    8890def render_to_string(template_name, dictionary=None, context_instance=None): 
  • django/branches/sqlalchemy/django/template/loader_tags.py

    r3666 r3724  
    5252            raise TemplateSyntaxError, error_msg 
    5353        if hasattr(parent, 'render'): 
    54             return parent 
     54            return parent # parent is a Template object 
    5555        try: 
    5656            source, origin = find_template_source(parent, self.template_dirs) 
     
    5858            raise TemplateSyntaxError, "Template %r cannot be extended, because it doesn't exist" % parent 
    5959        else: 
    60             return get_template_from_string(source, origin
     60            return get_template_from_string(source, origin, parent
    6161 
    6262    def render(self, context): 
  • django/branches/sqlalchemy/django/test/client.py

    r3658 r3724  
    11from cStringIO import StringIO 
    2 from django.contrib.admin.views.decorators import LOGIN_FORM_KEY, _encode_post_data 
    32from django.core.handlers.base import BaseHandler 
    43from django.core.handlers.wsgi import WSGIRequest 
    54from django.dispatch import dispatcher 
    65from django.http import urlencode, SimpleCookie 
    7 from django.template import signals 
     6from django.test import signals 
    87from django.utils.functional import curry 
    98 
     
    9796    """ 
    9897    def __init__(self, **defaults): 
    99         self.handler = TestHandler() 
     98        self.handler = ClientHandler() 
    10099        self.defaults = defaults 
    101100        self.cookie = SimpleCookie() 
     
    127126        on_template_render = curry(store_rendered_templates, data) 
    128127        dispatcher.connect(on_template_render, signal=signals.template_rendered) 
    129  
     128         
    130129        response = self.handler(environ) 
    131130         
     
    181180        """ 
    182181        A specialized sequence of GET and POST to log into a view that 
    183         is protected by @login_required or a similar access decorator. 
    184          
    185         path should be the URL of the login page, or of any page that 
    186         is login protected. 
    187          
    188         Returns True if login was successful; False if otherwise.         
    189         """ 
    190         # First, GET the login page.  
    191         # This is required to establish the session
     182        is protected by a @login_required access decorator. 
     183         
     184        path should be the URL of the page that is login protected. 
     185         
     186        Returns the response from GETting the requested URL after  
     187        login is complete. Returns False if login process failed. 
     188        """ 
     189        # First, GET the page that is login protected.  
     190        # This page will redirect to the login page
    192191        response = self.get(path) 
     192        if response.status_code != 302: 
     193            return False 
     194             
     195        login_path, data = response['Location'].split('?') 
     196        next = data.split('=')[1] 
     197 
     198        # Second, GET the login page; required to set up cookies 
     199        response = self.get(login_path, **extra) 
    193200        if response.status_code != 200: 
    194201            return False 
    195  
    196         # Set up the block of form data required by the login page
     202             
     203        # Last, POST the login data
    197204        form_data = { 
    198205            'username': username, 
    199206            'password': password, 
    200             'this_is_the_login_form': 1, 
    201             'post_data': _encode_post_data({LOGIN_FORM_KEY: 1}) 
     207            'next' : next, 
    202208        } 
    203         response = self.post(path, data=form_data, **extra) 
    204          
    205         # login page should give response 200 (if you requested the login 
    206         # page specifically), or 302 (if you requested a login 
    207         # protected page, to which the login can redirect). 
    208         return response.status_code in (200,302) 
     209        response = self.post(login_path, data=form_data, **extra) 
     210 
     211        # Login page should 302 redirect to the originally requested page 
     212        if response.status_code != 302 or response['Location'] != path: 
     213            return False 
     214 
     215        # Since we are logged in, request the actual page again 
     216        return self.get(path) 
  • django/branches/sqlalchemy/django/test/simple.py

    r3658 r3724  
    22from django.conf import settings 
    33from django.core import management 
     4from django.test.utils import setup_test_environment, teardown_test_environment 
    45from django.test.utils import create_test_db, destroy_test_db 
    56from django.test.testcases import OutputChecker, DocTestRunner 
     
    5253    will be added to the test suite. 
    5354    """ 
     55    setup_test_environment() 
    5456     
    5557    settings.DEBUG = False     
     
    6264        suite.addTest(test) 
    6365 
    64     old_name = create_test_db(verbosity) 
     66    old_name = settings.DATABASE_NAME 
     67    create_test_db(verbosity) 
    6568    management.syncdb(verbosity, interactive=False) 
    6669    unittest.TextTestRunner(verbosity=verbosity).run(suite) 
    6770    destroy_test_db(old_name, verbosity) 
     71     
     72    teardown_test_environment() 
  • django/branches/sqlalchemy/django/test/utils.py

    r3673 r3724  
    22from django.conf import settings 
    33from django.db import connection, transaction, backend 
     4from django.dispatch import dispatcher 
     5from django.test import signals 
     6from django.template import Template 
    47 
    58# The prefix to put on the default database name when creating 
     
    710TEST_DATABASE_PREFIX = 'test_' 
    811 
     12def instrumented_test_render(self, context): 
     13    """An instrumented Template render method, providing a signal  
     14    that can be intercepted by the test system Client 
     15     
     16    """ 
     17    dispatcher.send(signal=signals.template_rendered, sender=self, template=self, context=context) 
     18    return self.nodelist.render(context) 
     19     
     20def setup_test_environment(): 
     21    """Perform any global pre-test setup. This involves: 
     22         
     23        - Installing the instrumented test renderer 
     24         
     25    """ 
     26    Template.original_render = Template.render 
     27    Template.render = instrumented_test_render 
     28     
     29def teardown_test_environment(): 
     30    """Perform any global post-test teardown. This involves: 
     31 
     32        - Restoring the original test renderer 
     33         
     34    """ 
     35    Template.render = Template.original_render 
     36    del Template.original_render 
     37     
    938def _set_autocommit(connection): 
    1039    "Make sure a connection is in autocommit mode." 
     
    2251        TEST_DATABASE_NAME = ":memory:" 
    2352    else: 
    24         TEST_DATABASE_NAME = TEST_DATABASE_PREFIX + settings.DATABASE_NAME 
     53        if settings.TEST_DATABASE_NAME: 
     54            TEST_DATABASE_NAME = settings.TEST_DATABASE_NAME 
     55        else: 
     56            TEST_DATABASE_NAME = TEST_DATABASE_PREFIX + settings.DATABASE_NAME 
    2557         
    2658        # Create the test database and connect to it. We need to autocommit 
     
    5183                
    5284    connection.close() 
    53     old_database_name = settings.DATABASE_NAME 
    5485    settings.DATABASE_NAME = TEST_DATABASE_NAME 
    5586 
     
    5788    # the side effect of initializing the test database. 
    5889    cursor = connection.cursor() 
    59              
    60     return old_database_name 
    6190 
    6291def destroy_test_db(old_database_name, verbosity=1): 
     
    6796    if verbosity >= 1: 
    6897        print "Destroying test database..." 
     98    connection.close() 
     99    TEST_DATABASE_NAME = settings.DATABASE_NAME 
     100    settings.DATABASE_NAME = old_database_name 
     101 
    69102    if settings.DATABASE_ENGINE != "sqlite3": 
    70         connection.close() 
    71         TEST_DATABASE_NAME = settings.DATABASE_NAME 
    72         settings.DATABASE_NAME = old_database_name 
    73103        cursor = connection.cursor() 
    74104        _set_autocommit(connection) 
     
    76106        cursor.execute("DROP DATABASE %s" % backend.quote_name(TEST_DATABASE_NAME)) 
    77107        connection.close() 
    78  
  • django/branches/sqlalchemy/django/utils/datastructures.py

    r3113 r3724  
    188188        return self.__deepcopy__() 
    189189 
    190     def update(self, other_dict): 
    191         "update() extends rather than replaces existing key lists." 
    192         if isinstance(other_dict, MultiValueDict): 
    193             for key, value_list in other_dict.lists(): 
    194                 self.setlistdefault(key, []).extend(value_list) 
    195         else: 
    196             try: 
    197                 for key, value in other_dict.items(): 
    198                     self.setlistdefault(key, []).append(value) 
    199             except TypeError: 
    200                 raise ValueError, "MultiValueDict.update() takes either a MultiValueDict or dictionary" 
     190    def update(self, *args, **kwargs): 
     191        "update() extends rather than replaces existing key lists. Also accepts keyword args." 
     192        if len(args) > 1: 
     193            raise TypeError, "update expected at most 1 arguments, got %d", len(args) 
     194        if args: 
     195            other_dict = args[0] 
     196            if isinstance(other_dict, MultiValueDict): 
     197                for key, value_list in other_dict.lists(): 
     198                    self.setlistdefault(key, []).extend(value_list) 
     199            else: 
     200                try: 
     201                    for key, value in other_dict.items(): 
     202                        self.setlistdefault(key, []).append(value) 
     203                except TypeError: 
     204                    raise ValueError, "MultiValueDict.update() takes either a MultiValueDict or dictionary" 
     205        for key, value in kwargs.iteritems(): 
     206            self.setlistdefault(key, []).append(value) 
    201207 
    202208class DotExpandedDict(dict): 
  • django/branches/sqlalchemy/django/views/debug.py

    r3666 r3724  
    116116            'lineno': '?', 
    117117        }] 
    118     t = Template(TECHNICAL_500_TEMPLATE
     118    t = Template(TECHNICAL_500_TEMPLATE, name='Technical 500 template'
    119119    c = Context({ 
    120120        'exception_type': exc_type.__name__, 
     
    142142            return empty_urlconf(request) 
    143143 
    144     t = Template(TECHNICAL_404_TEMPLATE
     144    t = Template(TECHNICAL_404_TEMPLATE, name='Technical 404 template'
    145145    c = Context({ 
    146146        'root_urlconf': settings.ROOT_URLCONF, 
     
    155155def empty_urlconf(request): 
    156156    "Create an empty URLconf 404 error response." 
    157     t = Template(EMPTY_URLCONF_TEMPLATE
     157    t = Template(EMPTY_URLCONF_TEMPLATE, name='Empty URLConf template'
    158158    c = Context({ 
    159159        'project_name': settings.SETTINGS_MODULE.split('.')[0] 
     
    190190  <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
    191191  <meta name="robots" content="NONE,NOARCHIVE" /> 
    192   <title>{{ exception_type }} at {{ request.path }}</title> 
     192  <title>{{ exception_type }} at {{ request.path|escape }}</title> 
    193193  <style type="text/css"> 
    194194    html * { padding:0; margin:0; } 
     
    293293 
    294294<div id="summary"> 
    295   <h1>{{ exception_type }} at {{ request.path }}</h1> 
     295  <h1>{{ exception_type }} at {{ request.path|escape }}</h1> 
    296296  <h2>{{ exception_value|escape }}</h2> 
    297297  <table class="meta"> 
     
    302302    <tr> 
    303303      <th>Request URL:</th> 
    304       <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path }}</td> 
     304      <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path|escape }}</td> 
    305305    </tr> 
    306306    <tr> 
     
    310310    <tr> 
    311311      <th>Exception Value:</th> 
    312       <td>{{ exception_value }}</td> 
     312      <td>{{ exception_value|escape }}</td> 
    313313    </tr> 
    314314    <tr> 
     
    413413  {% endif %} 
    414414{% endfor %}<br/> 
    415 &nbsp;&nbsp;{{ exception_type }} at {{ request.path }}<br/> 
     415&nbsp;&nbsp;{{ exception_type }} at {{ request.path|escape }}<br/> 
    416416&nbsp;&nbsp;{{ exception_value|escape }}</code> 
    417417          </td> 
     
    547547<head> 
    548548  <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
    549   <title>Page not found at {{ request.path }}</title> 
     549  <title>Page not found at {{ request.path|escape }}</title> 
    550550  <meta name="robots" content="NONE,NOARCHIVE" /> 
    551551  <style type="text/css"> 
     
    577577      <tr> 
    578578        <th>Request URL:</th> 
    579       <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path }}</td> 
     579      <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path|escape }}</td> 
    580580      </tr> 
    581581    </table> 
     
    592592        {% endfor %} 
    593593      </ol> 
    594       <p>The current URL, <code>{{ request.path }}</code>, didn't match any of these.</p> 
     594      <p>The current URL, <code>{{ request.path|escape }}</code>, didn't match any of these.</p> 
    595595    {% else %} 
    596596      <p>{{ reason|escape }}</p> 
  • django/branches/sqlalchemy/django/views/static.py

    r3666 r3724  
    8282        t = loader.get_template('static/directory_index') 
    8383    except TemplateDoesNotExist: 
    84         t = Template(DEFAULT_DIRECTORY_INDEX_TEMPLATE
     84        t = Template(DEFAULT_DIRECTORY_INDEX_TEMPLATE, name='Default directory index template'
    8585    files = [] 
    8686    for f in os.listdir(fullpath): 
  • django/branches/sqlalchemy/docs/add_ons.txt

    r3509 r3724  
    154154.. _sites documentation: http://www.djangoproject.com/documentation/sites/ 
    155155 
     156sitemaps 
     157======== 
     158 
     159A framework for generating Google sitemap XML files. 
     160 
     161See the `sitemaps documentation`_. 
     162 
     163.. _sitemaps documentation: http://www.djangoproject.com/documentation/sitemaps/ 
     164 
    156165syndication 
    157166=========== 
  • django/branches/sqlalchemy/docs/contributing.txt

    r3455 r3724  
    168168 
    169169          {{foo}} 
     170 
     171    * In Django views, the first parameter in a view function should be called 
     172      ``request``. 
     173 
     174      Do this:: 
     175 
     176          def my_view(request, foo): 
     177              # ... 
     178 
     179      Don't do this:: 
     180 
     181          def my_view(req, foo): 
     182              # ... 
    170183 
    171184    * Please don't put your name in the code. While we appreciate all 
  • django/branches/sqlalchemy/docs/django-admin.txt

    r3678 r3724  
    346346options. 
    347347 
     348--noinput 
     349--------- 
     350 
     351Inform django-admin that the user should NOT be prompted for any input. Useful if 
     352the django-admin script will be executed as an unattended, automated script. 
     353 
     354--noreload 
     355---------- 
     356 
     357Disable the use of the auto-reloader when running the development server. 
     358