Django

Code

Changeset 4142

Show
Ignore:
Timestamp:
11/29/06 14:16:50 (2 years ago)
Author:
jpellerin
Message:

[multi-db] Merge trunk to [3850]. Some tests still failing.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/multiple-db-support/AUTHORS

    r4141 r4142  
    8383    Brant Harris 
    8484    heckj@mac.com 
     85    Joel Heenan <joelh-django@planetjoel.com> 
    8586    hipertracker@gmail.com 
    8687    Ian Holsman <http://feh.holsman.net/> 
  • django/branches/multiple-db-support/django/conf/global_settings.py

    r4141 r4142  
    278278 
    279279# The profanities that will trigger a validation error in the 
    280 # 'hasNoProfanities' validator. All of these should be in lower-case. 
    281 PROFANITIES_LIST = ['asshat', 'asshead', 'asshole', 'cunt', 'fuck', 'gook', 'nigger', 'shit'] 
     280# 'hasNoProfanities' validator. All of these should be in lowercase. 
     281PROFANITIES_LIST = ('asshat', 'asshead', 'asshole', 'cunt', 'fuck', 'gook', 'nigger', 'shit') 
    282282 
    283283# The group ID that designates which users are banned. 
  • django/branches/multiple-db-support/django/conf/locale/de/LC_MESSAGES/django.po

    r4141 r4142  
    88"Project-Id-Version: Django 1.0\n" 
    99"Report-Msgid-Bugs-To: \n" 
    10 "POT-Creation-Date: 2006-09-25 15:39+0200\n" 
     10"POT-Creation-Date: 2006-09-25 16:04+0200\n" 
    1111"PO-Revision-Date: 2005-10-08 00:03+0200\n" 
    1212"Last-Translator: Georg Bauer <gb@bofh.ms>\n" 
     
    584584 
    585585#: contrib/admin/views/doc.py:164 
     586#, python-format 
    586587msgid "App %r not found" 
    587588msgstr "Anwendung %r nicht gefunden" 
     
    823824 
    824825#: contrib/admin/templates/admin/index.html:18 
     826#, python-format 
    825827msgid "%(name)s" 
    826828msgstr "%(name)s" 
     
    868870 
    869871#: contrib/admin/templates/admin/delete_confirmation.html:14 
     872#, python-format 
    870873msgid "" 
    871874"Deleting the %(object_name)s '%(escaped_object)s' would result in deleting " 
     
    878881 
    879882#: contrib/admin/templates/admin/delete_confirmation.html:21 
     883#, python-format 
    880884msgid "" 
    881885"Are you sure you want to delete the %(object_name)s \"%(escaped_object)s\"? " 
    882886"All of the following related items will be deleted:" 
    883887msgstr "" 
    884 "Sind Sie sicher, das Sie %(object_name)s \"%(escaped_object)s\" l�en wollen? Es
    885 "werden zus�lich die folgenden abh�igen Daten mit gel�t:" 
     888"Sind Sie sicher, das Sie %(object_name)s \"%(escaped_object)s\" l�en
     889"wollen? Es werden zus�lich die folgenden abh�igen Daten mit gel�t:" 
    886890 
    887891#: contrib/admin/templates/admin/delete_confirmation.html:26 
     
    890894 
    891895#: contrib/admin/templates/admin/filter.html:2 
     896#, python-format 
    892897msgid " By %(filter_title)s " 
    893898msgstr " Nach %(filter_title)s " 
     
    956961"the appropriate user." 
    957962msgstr "" 
    958 "Irgendetwas ist falsch mit der Datenbankkonfiguration. Bitte sicherstellen, das
    959 "die richtigen Datenbanktabellen angelegt wurden und bitte sicherstellen, das die
    960 "Datenbank vom verwendeten Datenbankbenutzer auch lesbar ist." 
     963"Irgendetwas ist falsch mit der Datenbankkonfiguration. Bitte sicherstellen,
     964"das die richtigen Datenbanktabellen angelegt wurden und bitte sicherstellen,
     965"das die Datenbank vom verwendeten Datenbankbenutzer auch lesbar ist." 
    961966 
    962967#: contrib/admin/templates/admin/auth/user/add_form.html:6 
     
    12461251"will use 'flatpages/default.html'." 
    12471252msgstr "" 
    1248 "Beispiel: 'flatpages/contact_page.html'. Wenn dieses Feld nicht gef�st, wird
    1249 "'flatpages/default.html' als Standard gew�t." 
     1253"Beispiel: 'flatpages/contact_page.html'. Wenn dieses Feld nicht gef�st,
     1254"wird 'flatpages/default.html' als Standard gew�t." 
    12501255 
    12511256#: contrib/flatpages/models.py:14 
     
    13441349"instead of deleting accounts." 
    13451350msgstr "" 
    1346 "Gibt an, ob der Benutzer sich an der Administrationsseite anmelden kann. Anstelle
    1347 "Benutzer zu l�en, kann das hier auch einfach abgeschaltet werden." 
     1351"Gibt an, ob der Benutzer sich an der Administrationsseite anmelden kann.
     1352"Anstelle Benutzer zu l�en, kann das hier auch einfach abgeschaltet werden." 
    13481353 
    13491354#: contrib/auth/models.py:97 
     
    14171422msgid "This account is inactive." 
    14181423msgstr "Dieser Benutzer ist inaktiv." 
     1424 
     1425#: contrib/auth/forms.py:84 
     1426msgid "" 
     1427"That e-mail address doesn't have an associated user acount. Are you sure " 
     1428"you've registered?" 
     1429msgstr "" 
     1430"Die Email-Adresse hat keinen Benutzer zugeordnet. Sicher, das die Adresse " 
     1431"hier angemeldet ist?" 
     1432 
     1433#: contrib/auth/forms.py:116 
     1434msgid "The two 'new password' fields didn't match." 
     1435msgstr "Die zwei Passw�r sind nicht gleich." 
     1436 
     1437#: contrib/auth/forms.py:123 
     1438msgid "Your old password was entered incorrectly. Please enter it again." 
     1439msgstr "Das alte Passwort war falsch. Bitte neu eingeben." 
    14191440 
    14201441#: contrib/contenttypes/models.py:20 
     
    18651886 
    18661887#: core/validators.py:142 
     1888#, python-format 
    18671889msgid "Invalid date: %s." 
    18681890msgstr "Ung�s Datum: %s" 
     
    18881910#: core/validators.py:172 core/validators.py:401 forms/__init__.py:661 
    18891911msgid "No file was submitted. Check the encoding type on the form." 
    1890 msgstr "Es wurde keine Datei geschickt. Eventuell ist das Formular-Encoding falsch." 
     1912msgstr "" 
     1913"Es wurde keine Datei geschickt. Eventuell ist das Formular-Encoding falsch." 
    18911914 
    18921915#: core/validators.py:176 
     
    20002023 
    20012024#: core/validators.py:381 
     2025#, python-format 
    20022026msgid "" 
    20032027"Please enter a valid decimal number with a whole part of at most %s digit." 
     
    21042128 
    21052129#: views/generic/create_update.py:43 
     2130#, python-format 
    21062131msgid "The %(verbose_name)s was created successfully." 
    21072132msgstr "%(verbose_name)s wurde erfolgreich angelegt." 
    21082133 
    21092134#: views/generic/create_update.py:117 
     2135#, python-format 
    21102136msgid "The %(verbose_name)s was updated successfully." 
    21112137msgstr "%(verbose_name)s wurde erfolgreich aktualisiert." 
    21122138 
    21132139#: views/generic/create_update.py:184 
     2140#, python-format 
    21142141msgid "The %(verbose_name)s was deleted." 
    21152142msgstr "%(verbose_name)s wurde gel�t" 
  • django/branches/multiple-db-support/django/conf/locale/zh_CN/LC_MESSAGES/djangojs.po

    r3227 r4142  
    44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 
    55# 
    6 #, fuzzy 
    76msgid "" 
    87msgstr "" 
    9 "Project-Id-Version: PACKAGE VERSION\n" 
     8"Project-Id-Version: Django 0.95\n" 
    109"Report-Msgid-Bugs-To: \n" 
    1110"POT-Creation-Date: 2006-03-21 18:43+0800\n" 
    12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 
    13 "Last-Translator: FULL NAME <max@exoweb.net>\n" 
    14 "Language-Team: LANGUAGE <LL@li.org>\n" 
     11"PO-Revision-Date: 2006-09-25 08:35+0800\n" 
     12"Last-Translator: limodou <limodou@gmail.com>\n" 
     13"Language-Team: limodou <limodou@gmail.com>\n" 
    1514"MIME-Version: 1.0\n" 
    1615"Content-Type: text/plain; charset=utf-8\n" 
     
    1918#: contrib/admin/media/js/SelectFilter2.js:33 
    2019msgid "Available %s" 
    21 msgstr "可 %s" 
     20msgstr "可 %s" 
    2221 
    2322#: contrib/admin/media/js/SelectFilter2.js:41 
     
    3130#: contrib/admin/media/js/SelectFilter2.js:48 
    3231msgid "Remove" 
    33 msgstr "移出
     32msgstr "删除
    3433 
    3534#: contrib/admin/media/js/SelectFilter2.js:53 
    3635msgid "Chosen %s" 
    37 msgstr "选 %s" 
     36msgstr "选中的 %s" 
    3837 
    3938#: contrib/admin/media/js/SelectFilter2.js:54 
    4039msgid "Select your choice(s) and click " 
    41 msgstr "挑选你的选择并且点击 " 
     40msgstr "选择并点击 " 
    4241 
    4342#: contrib/admin/media/js/SelectFilter2.js:59 
    4443msgid "Clear all" 
    45 msgstr "清除所有
     44msgstr "清除全部
    4645 
    4746#: contrib/admin/media/js/dateparse.js:32 
    4847#: contrib/admin/media/js/calendar.js:24 
    49 msgid "" 
    50 "January February March April May June July August September October November " 
    51 "December" 
     48msgid "January February March April May June July August September October November December" 
    5249msgstr "一月 二月 三月 四月 五月 六月 六月 七月 八月 九月 十月 十一月 十二月" 
    5350 
    5451#: contrib/admin/media/js/dateparse.js:33 
    5552msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday" 
    56 msgstr "星期 星期一 星期二 星期三 星期四 星期五 星期六" 
     53msgstr "星期 星期一 星期二 星期三 星期四 星期五 星期六" 
    5754 
    5855#: contrib/admin/media/js/calendar.js:25 
    5956msgid "S M T W T F S" 
    60 msgstr "日 月 火 水 木 金 土
     57msgstr "日 一 二 三 四 五 六
    6158 
    6259#: contrib/admin/media/js/admin/DateTimeShortcuts.js:45 
     
    106103msgid "Tomorrow" 
    107104msgstr "明天" 
     105 
  • django/branches/multiple-db-support/django/conf/locale/zh_CN/LC_MESSAGES/django.po

    r2933 r4142  
    99"Report-Msgid-Bugs-To: \n" 
    1010"POT-Creation-Date: 2006-05-16 10:10+0200\n" 
    11 "PO-Revision-Date: 2006-05-17 13:47+0800\n" 
     11"PO-Revision-Date: 2006-09-01 22:05+0800\n" 
    1212"Last-Translator: limodou <limodou@gmail.com>\n" 
    1313"Language-Team: Simplified Chinese <limodou@gmail.com>\n" 
     
    11681168#: contrib/auth/models.py:77 
    11691169msgid "Permissions" 
    1170 msgstr "许可
     1170msgstr "权限
    11711171 
    11721172#: contrib/auth/models.py:78 
  • django/branches/multiple-db-support/django/contrib/auth/decorators.py

    r4139 r4142  
    3030def permission_required(perm, login_url=LOGIN_URL): 
    3131    """ 
    32     Decorator for views that checks if a user has a particular permission 
    33     enabled, redirectiing to the log-in page if necessary. 
     32    Decorator for views that checks whether a user has a particular permission 
     33    enabled, redirecting to the log-in page if necessary. 
    3434    """ 
    3535    return user_passes_test(lambda u: u.has_perm(perm), login_url=login_url) 
  • django/branches/multiple-db-support/django/contrib/auth/forms.py

    r3523 r4142  
    55from django.core import validators 
    66from django import forms 
     7from django.utils.translation import gettext_lazy as _ 
    78 
    89class UserCreationForm(forms.Manipulator): 
     
    1415            forms.PasswordField(field_name='password1', length=30, maxlength=60, is_required=True), 
    1516            forms.PasswordField(field_name='password2', length=30, maxlength=60, is_required=True, 
    16                 validator_list=[validators.AlwaysMatchesOtherField('password1', "The two password fields didn't match.")]), 
     17                validator_list=[validators.AlwaysMatchesOtherField('password1', _("The two password fields didn't match."))]), 
    1718        ) 
    1819 
     
    2223        except User.DoesNotExist: 
    2324            return 
    24         raise validators.ValidationError, 'A user with that username already exists.' 
     25        raise validators.ValidationError, _('A user with that username already exists.') 
    2526 
    2627    def save(self, new_data): 
     
    8283            self.user_cache = User.objects.get(email__iexact=new_data) 
    8384        except User.DoesNotExist: 
    84             raise validators.ValidationError, "That e-mail address doesn't have an associated user acount. Are you sure you've registered?" 
     85            raise validators.ValidationError, _("That e-mail address doesn't have an associated user acount. Are you sure you've registered?") 
    8586 
    8687    def save(self, domain_override=None, email_template_name='registration/password_reset_email.html'): 
     
    114115                validator_list=[self.isValidOldPassword]), 
    115116            forms.PasswordField(field_name="new_password1", length=30, maxlength=30, is_required=True, 
    116                 validator_list=[validators.AlwaysMatchesOtherField('new_password2', "The two 'new password' fields didn't match.")]), 
     117                validator_list=[validators.AlwaysMatchesOtherField('new_password2', _("The two 'new password' fields didn't match."))]), 
    117118            forms.PasswordField(field_name="new_password2", length=30, maxlength=30, is_required=True), 
    118119        ) 
     
    121122        "Validates that the old_password field is correct." 
    122123        if not self.user.check_password(new_data): 
    123             raise validators.ValidationError, "Your old password was entered incorrectly. Please enter it again." 
     124            raise validators.ValidationError, _("Your old password was entered incorrectly. Please enter it again.") 
    124125 
    125126    def save(self, new_data): 
  • django/branches/multiple-db-support/django/core/management.py

    r4139 r4142  
    11291129        type='choice', choices=['0', '1', '2'], 
    11301130        help='Verbosity level; 0=minimal output, 1=normal output, 2=all output'), 
    1131     parser.add_option('--adminmedia', dest='admin_media_path', default='', help='Lets you manually specify the directory to serve admin media from when running the development server.'), 
     1131    parser.add_option('--adminmedia', dest='admin_media_path', default='', help='Specifies the directory from which to serve admin media for runserver.'), 
    11321132 
    11331133    options, args = parser.parse_args(argv[1:]) 
  • django/branches/multiple-db-support/django/core/servers/basehttp.py

    r4139 r4142  
    595595    security and is not super efficient. 
    596596    """ 
    597     def __init__(self, application, media_dir = None): 
     597    def __init__(self, application, media_dir=None): 
    598598        from django.conf import settings 
    599599        self.application = application 
  • django/branches/multiple-db-support/django/core/validators.py

    r4141 r4142  
    250250    """ 
    251251    field_data = field_data.lower() # normalize 
    252     words_seen = [w for w in settings.PROFANITIES_LIST if field_data.find(w) > -1
     252    words_seen = [w for w in settings.PROFANITIES_LIST if w in field_data
    253253    if words_seen: 
    254254        from django.utils.text import get_text_list 
     
    378378            raise ValidationError, ngettext("Please enter a valid decimal number with at most %s total digit.", 
    379379                "Please enter a valid decimal number with at most %s total digits.", self.max_digits) % self.max_digits 
    380         if (not '.' in data and len(data) > (max_allowed_length - self.decimal_places)) or ('.' in data and len(data) > (self.max_digits - (self.decimal_places - len(data.split('.')[1])) + 1)): 
     380        if (not '.' in data and len(data) > (max_allowed_length - self.decimal_places - 1)) or ('.' in data and len(data) > (max_allowed_length - (self.decimal_places - len(data.split('.')[1])))): 
    381381            raise ValidationError, ngettext( "Please enter a valid decimal number with a whole part of at most %s digit.", 
    382382                "Please enter a valid decimal number with a whole part of at most %s digits.", str(self.max_digits-self.decimal_places)) % str(self.max_digits-self.decimal_places) 
  • django/branches/multiple-db-support/django/db/backends/ansi/sql.py

    r4141 r4142  
    7474 
    7575        for f in opts.fields: 
    76             if isinstance(f, models.ForeignKey): 
     76            if isinstance(f, (models.ForeignKey, models.OneToOneField)): 
    7777                rel_field = f.rel.get_related_field() 
    7878                data_type = self.get_rel_data_type(rel_field) 
  • django/branches/multiple-db-support/django/db/models/fields/__init__.py

    r3581 r4142  
    368368    def to_python(self, value): 
    369369        if value in (True, False): return value 
    370         if value in ('t', 'True'): return True 
    371         if value in ('f', 'False'): return False 
     370        if value in ('t', 'True', '1'): return True 
     371        if value in ('f', 'False', '0'): return False 
    372372        raise validators.ValidationError, gettext("This value must be either True or False.") 
    373373 
  • django/branches/multiple-db-support/django/db/models/fields/related.py

    r3523 r4142  
    619619        else: 
    620620            msg = gettext_lazy('Hold down "Control", or "Command" on a Mac, to select more than one.') 
    621         self.help_text = string_concat(self.help_text, msg) 
     621        self.help_text = string_concat(self.help_text, ' ', msg) 
    622622 
    623623    def get_manipulator_field_objs(self): 
  • django/branches/multiple-db-support/django/db/models/manipulators.py

    r3581 r4142  
    216216                        for f in related.opts.many_to_many: 
    217217                            if child_follow.get(f.name, None) and not f.rel.edit_inline: 
    218                                 was_changed = getattr(new_rel_obj, 'set_%s' % f.name)(rel_new_data[f.attname]
    219                                 if self.change and was_changed
     218                                setattr(new_rel_obj, f.name, f.rel.to.objects.filter(pk__in=rel_new_data[f.attname])
     219                                if self.change
    220220                                    self.fields_changed.append('%s for %s "%s"' % (f.verbose_name, related.opts.verbose_name, new_rel_obj)) 
    221221 
  • django/branches/multiple-db-support/django/db/models/query.py

    r3427 r4142  
    733733            # The very-last is the lookup_type (equals, like, etc). 
    734734            # The second-last is the table column on which the lookup_type is 
    735             # to be performed. 
    736             # The exceptions to this are: 
    737             # 1)  "pk", which is an implicit id__exact; 
    738             #     if we find "pk", make the lookup_type "exact', and insert 
    739             #     a dummy name of None, which we will replace when 
    740             #     we know which table column to grab as the primary key. 
    741             # 2)  If there is only one part, or the last part is not a query 
    742             #     term, assume that the query is an __exact 
     735            # to be performed. If this name is 'pk', it will be substituted with 
     736            # the name of the primary key. 
     737            # If there is only one part, or the last part is not a query 
     738            # term, assume that the query is an __exact 
    743739            lookup_type = path.pop() 
    744740            if lookup_type == 'pk': 
     
    790786    # Has the primary key been requested? If so, expand it out 
    791787    # to be the name of the current class' primary key 
    792     if name is None
     788    if name is None or name == 'pk'
    793789        name = current_opts.pk.name 
    794790 
  • django/branches/multiple-db-support/django/forms/__init__.py

    r4141 r4142  
    5555        "Returns dictionary mapping field_names to error-message lists" 
    5656        errors = {} 
     57        self.prepare(new_data) 
    5758        for field in self.fields: 
    5859            errors.update(field.get_validation_errors(new_data)) 
     
    639640                checked_html = ' checked="checked"' 
    640641            field_name = '%s%s' % (self.field_name, value) 
    641             output.append('<li><input type="checkbox" id="%s" class="v%s" name="%s"%s /> <label for="%s">%s</label></li>' % \ 
     642            output.append('<li><input type="checkbox" id="%s" class="v%s" name="%s"%s value="on" /> <label for="%s">%s</label></li>' % \ 
    642643                (self.get_id() + escape(value), self.__class__.__name__, field_name, checked_html, 
    643644                self.get_id() + escape(value), choice)) 
  • django/branches/multiple-db-support/django/middleware/common.py

    r4139 r4142  
    6565                path = request.get_full_path() 
    6666                if referer and not _is_ignorable_404(path) and (is_internal or '?' not in referer): 
    67                     ua = request.META.get('HTTP_USER_AGENT','<none>') 
     67                    ua = request.META.get('HTTP_USER_AGENT', '<none>') 
    6868                    mail_managers("Broken %slink on %s" % ((is_internal and 'INTERNAL ' or ''), domain), 
    69                         "Referrer: %s\nRequested URL: %s\nUser Agent: %s\n" % (referer, request.get_full_path(), ua)) 
     69                        "Referrer: %s\nRequested URL: %s\nUser agent: %s\n" % (referer, request.get_full_path(), ua)) 
    7070                return response 
    7171 
  • django/branches/multiple-db-support/django/views/generic/create_update.py

    r3581 r4142  
    103103        raise Http404, "No %s found for %s" % (model._meta.verbose_name, lookup_kwargs) 
    104104 
    105     manipulator = model.ChangeManipulator(getattr(object, object._meta.pk.name), follow=follow) 
     105    manipulator = model.ChangeManipulator(getattr(object, object._meta.pk.attname), follow=follow) 
    106106 
    107107    if request.POST: 
     
    143143            c[key] = value 
    144144    response = HttpResponse(t.render(c)) 
    145     populate_xheaders(request, response, model, getattr(object, object._meta.pk.name)) 
     145    populate_xheaders(request, response, model, getattr(object, object._meta.pk.attname)) 
    146146    return response 
    147147 
     
    197197                c[key] = value 
    198198        response = HttpResponse(t.render(c)) 
    199         populate_xheaders(request, response, model, getattr(object, object._meta.pk.name)) 
     199        populate_xheaders(request, response, model, getattr(object, object._meta.pk.attname)) 
    200200        return response 
  • django/branches/multiple-db-support/docs/apache_auth.txt

    r3012 r4142  
    77`authentication system`_ directly.  For example, you could: 
    88 
    9     * Serve media files directly from Apache only to authenticated users. 
     9    * Serve static/media files directly from Apache only to authenticated users. 
    1010 
    1111    * Authenticate access to a Subversion_ repository against Django users with 
  • django/branches/multiple-db-support/docs/authentication.txt

    r4139 r4142  
    457457    my_view = user_passes_test(lambda u: u.has_perm('polls.can_vote'))(my_view) 
    458458 
    459 We are using this particular test as a relatively simple example, however be 
    460 aware that if you just want to test if a permission is available to a user, 
    461 you can use the ``permission_required()`` decorator described below
     459We're using this particular test as a relatively simple example. However, if 
     460you just want to test whether a permission is available to a user, you can use 
     461the ``permission_required()`` decorator, described later in this document
    462462 
    463463Here's the same thing, using Python 2.4's decorator syntax:: 
     
    496496~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    497497 
    498 Since checking whether a user has a particular permission available to them is a 
    499 relatively common operation, Django provides a shortcut for that particular 
    500 case: the ``permission_required()`` decorator. Using this decorator, the 
    501 earlier example can be written as:: 
     498**New in Django development version** 
     499 
     500It's a relatively common task to check whether a user has a particular 
     501permission. For that reason, Django provides a shortcut for that case: the 
     502``permission_required()`` decorator. Using this decorator, the earlier example 
     503can be written as:: 
    502504 
    503505    from django.contrib.auth.decorators import permission_required 
    504       
    505     def my_view(request): 
    506         # ... 
    507       
     506 
     507    def my_view(request): 
     508        # ... 
    508509    my_view = permission_required('polls.can_vote')(my_view) 
    509510 
    510511Note that ``permission_required()`` also takes an optional ``login_url`` 
    511 parameter. 
     512parameter. Example:: 
     513 
     514    from django.contrib.auth.decorators import permission_required 
     515 
     516    def my_view(request): 
     517        # ... 
     518    my_view = permission_required('polls.can_vote', login_url='/loginpage/')(my_view) 
     519 
     520As in the ``login_required`` decorator, ``login_url`` defaults to 
     521``'/accounts/login/'``. 
    512522 
    513523Limiting access to generic views 
     
    634644 
    635645    {% if user.is_authenticated %} 
    636         <p>Welcome, {{ user.username }}. Thanks for logging in.</p>     
     646        <p>Welcome, {{ user.username }}. Thanks for logging in.</p> 
    637647    {% else %} 
    638648        <p>Welcome, new user. Please log in.</p> 
  • django/branches/multiple-db-support/docs/contributing.txt

    r4139 r4142  
    260260 
    261261The Django tests all use the testing infrastructure that ships with Django for 
    262 testing applications. See `Testing Django Applications`_ for an explanation of 
     262testing applications. See `Testing Django applications`_ for an explanation of 
    263263how to write new tests. 
    264264 
    265 .. _Testing Django Applications: http://www.djangoproject.com/documentation/testing/ 
     265.. _Testing Django applications: http://www.djangoproject.com/documentation/testing/ 
    266266 
    267267Running the unit tests 
     
    274274Yes, the unit tests need a settings module, but only for database connection 
    275275info -- the ``DATABASE_ENGINE``, ``DATABASE_USER`` and ``DATABASE_PASSWORD``. 
    276 You will also need a ``ROOT_URLCONF`` setting (it's value is ignored; it just 
     276You will also need a ``ROOT_URLCONF`` setting (its value is ignored; it just 
    277277needs to be present) and a ``SITE_ID`` setting (any integer value will do) in 
    278278order for all the tests to pass. 
  • django/branches/multiple-db-support/docs/db-api.txt

    r4139 r4142  
    11411141 
    11421142For convenience, Django provides a ``pk`` lookup type, which stands for 
    1143 "primary_key". This is shorthand for "an exact lookup on the primary-key." 
     1143"primary_key".  
    11441144 
    11451145In the example ``Blog`` model, the primary key is the ``id`` field, so these 
     
    11501150    Blog.objects.get(pk=14) # pk implies id__exact 
    11511151 
     1152The use of ``pk`` isn't limited to ``__exact`` queries -- any query term  
     1153can be combined with ``pk`` to perform a query on the primary key of a model:: 
     1154 
     1155    # Get blogs entries  with id 1, 4 and 7 
     1156    Blog.objects.filter(pk__in=[1,4,7]) 
     1157    # Get all blog entries with id > 14 
     1158    Blog.objects.filter(pk__gt=14)  
     1159     
    11521160``pk`` lookups also work across joins. For example, these three statements are 
    11531161equivalent:: 
  • django/branches/multiple-db-support/docs/django-admin.txt

    r4139 r4142  
    393393    django-admin.py manage.py --adminmedia=/tmp/new-admin-style/ 
    394394 
    395 Tell Django where to find the various stylesheets and Javascript files for the 
    396 admin interface when running the development server. Normally these files are 
    397 served out of the Django source tree, but since some designers change these 
    398 files for their site, this option allows you to test against custom versions. 
     395Tells Django where to find the various CSS and JavaScript files for the admin 
     396interface when running the development server. Normally these files are served 
     397out of the Django source tree, but because some designers customize these files 
     398for their site, this option allows you to test against custom versions. 
    399399 
    400400Extra niceties 
  • django/branches/multiple-db-support/docs/forms.txt

    r4139 r4142  
    338338 
    339339    * We set ``new_data`` based upon ``flatten_data()`` from the manipulator. 
    340       ``flatten_data()`` takes the data from the original object under  
    341       manipulation, and converts it into a data dictionary that can be used  
     340      ``flatten_data()`` takes the data from the original object under 
     341      manipulation, and converts it into a data dictionary that can be used 
    342342      to populate form elements with the existing values for the object. 
    343343 
     
    405405        form = forms.FormWrapper(manipulator, new_data, errors) 
    406406        return render_to_response('contact_form.html', {'form': form}) 
    407          
     407 
    408408``FileField`` and ``ImageField`` special cases 
    409409============================================== 
     
    482482to put punctuation at the end of your validation messages. 
    483483 
    484 When Are Validators Called? 
     484When are validators called? 
    485485--------------------------- 
    486486 
     
    488488required fields are present and non-empty. For each field that passes that 
    489489test *and if the form submission contained data* for that field, all the 
    490 validators for that field are called in turn. The emphasised portion in the 
     490validators for that field are called in turn. The emphasized portion in the 
    491491last sentence is important: if a form field is not submitted (because it 
    492492contains no data -- which is normal HTML behaviour), the validators are not 
     
    498498contribute to the form submission. 
    499499 
    500 If you would like your validator to *always* run, regardless of whether the 
    501 field it is attached to contains any data, set the ``always_test`` attribut
    502 on the validator function. For example:: 
     500If you would like your validator to run *always*, regardless of whether its 
     501attached field contains any data, set the ``always_test`` attribute on th
     502validator function. For example:: 
    503503 
    504504    def my_custom_validator(field_data, all_data): 
    505505        # ... 
    506  
    507506    my_custom_validator.always_test = True 
    508507 
    509508This validator will always be executed for any field it is attached to. 
    510509 
    511 Ready-made Validators 
     510Ready-made validators 
    512511--------------------- 
    513512 
  • django/branches/multiple-db-support/docs/model-api.txt

    r4139 r4142  
    546546If ``False``, the field will not be editable in the admin or via form 
    547547processing using the object's ``AddManipulator`` or ``ChangeManipulator`` 
    548 classes. Default is ``True``. 
     548classes. Default is ``True``. 
    549549 
    550550``help_text`` 
  • django/branches/multiple-db-support/docs/serialization.txt

    r4139 r4142  
    44 
    55.. note:: 
    6      
     6 
    77    This API is currently under heavy development and may change -- 
    88    perhaps drastically -- in the future. 
    9      
     9 
    1010    You have been warned. 
    11      
     11 
    1212Django's serialization framework provides a mechanism for "translating" Django 
    1313objects into other formats. Usually these other formats will be text-based and 
     
    2222    from django.core import serializers 
    2323    data = serializers.serialize("xml", SomeModel.objects.all()) 
    24      
     24 
    2525The arguments to the ``serialize`` function are the format to serialize the 
    2626data to (see `Serialization formats`_) and a QuerySet_ to serialize. 
     
    3535    xml_serializer.serialize(queryset) 
    3636    data = xml_serializer.getvalue() 
    37      
     37 
    3838This is useful if you want to serialize data directly to a file-like object 
    3939(which includes a HTTPResponse_):: 
     
    5151    for obj in serializers.deserialize("xml", data): 
    5252        do_something_with(obj) 
    53      
     53 
    5454As you can see, the ``deserialize`` function takes the same format argument as 
    5555``serialize``, a string or stream of data, and returns an iterator. 
     
    7070        if object_should_be_saved(deserialized_object): 
    7171            obj.save() 
    72              
     72 
    7373In other words, the usual use is to examine the deserialized objects to make 
    7474sure that they are "appropriate" for saving before doing so.  Of course, if you trust your data source you could just save the object and move on. 
     
    9090 
    9191    ``python``  Translates to and from "simple" Python objects (lists, dicts, 
    92                 strings, etc.).  Not really all that useful on its own, but  
     92                strings, etc.).  Not really all that useful on its own, but 
    9393                used as a base for other serializers. 
    9494    ==========  ============================================================== 
     
    9797.. _simplejson: http://undefined.org/python/#simplejson 
    9898 
    99 Notes For Specific Serialization Formats 
     99Notes for specific serialization formats 
    100100---------------------------------------- 
    101101 
     
    103103~~~~ 
    104104 
    105 If you are using UTF-8 (or any other non-ASCII encoding) data with the JSON 
     105If you're using UTF-8 (or any other non-ASCII encoding) data with the JSON 
    106106serializer, you must pass ``ensure_ascii=False`` as a parameter to the 
    107 ``serialize()`` call. Otherwise the output will not be encoded correctly. 
     107``serialize()`` call. Otherwise, the output won't be encoded correctly. 
    108108 
    109109For example:: 
  • django/branches/multiple-db-support/docs/settings.txt

    r4139 r4142  
    607607---------------- 
    608608 
    609 A list of profanities that will trigger a validation error when the 
    610 ``hasNoProfanities`` validator is called. 
     609A tuple of profanities, as strings, that will trigger a validation error when 
     610the ``hasNoProfanities`` validator is called. 
     611 
     612We don't list the default values here, because that would be profane. To see 
    &nb