Django

Code

Changeset 1408

Show
Ignore:
Timestamp:
11/24/05 18:09:46 (3 years ago)
Author:
rjwittams
Message:

Merged to trunk 1407

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/new-admin/django/conf/locale/de/LC_MESSAGES/django.po

    r1382 r1408  
    784784#: contrib/admin/templates/registration/password_reset_form.html:4 
    785785#: contrib/admin/templates/registration/password_reset_form.html:6 
     786#: contrib/admin/templates/registration/password_reset_form.html:10 
    786787#: contrib/admin/templates/registration/password_reset_done.html:4 
    787788msgid "Password reset" 
     
    12861287 
    12871288#: models/auth.py:37 
    1288 msgid "Use '[algo]$[salt]$[hexdigest]
    1289 msgstr "Im Format '[algo]$[salt]$[hexdigest]
     1289msgid "Use '[algo]$[salt]$[hexdigest]'
     1290msgstr "Im Format '[algo]$[salt]$[hexdigest]'
    12901291 
    12911292#: models/auth.py:38 
  • django/branches/new-admin/django/conf/locale/sk/LC_MESSAGES/django.po

    r1382 r1408  
    1717"Content-Transfer-Encoding: 8bit\n" 
    1818 
     19#: contrib/redirects/models/redirects.py:7 
     20msgid "redirect from" 
     21msgstr "presmerovaný z" 
     22 
     23#: contrib/redirects/models/redirects.py:8 
     24msgid "" 
     25"This should be an absolute path, excluding the domain name. Example: '/" 
     26"events/search/'." 
     27msgstr "" 
     28"Tu by sa mala použiť absolútna cesta, bez domény. Napr.: '/events/search/'." 
     29 
     30#: contrib/redirects/models/redirects.py:9 
     31msgid "redirect to" 
     32msgstr "presmerovaný na " 
     33 
     34#: contrib/redirects/models/redirects.py:10 
     35msgid "" 
     36"This can be either an absolute path (as above) or a full URL starting with " 
     37"'http://'." 
     38msgstr "" 
     39"Tu môže byť buď absolútna cesta (ako hore) alebo plné  URL začínajúce s " 
     40"'http://'." 
     41 
     42#: contrib/redirects/models/redirects.py:12 
     43msgid "redirect" 
     44msgstr "presmerovanie" 
     45 
     46#: contrib/redirects/models/redirects.py:13 
     47msgid "redirects" 
     48msgstr "presmerovania" 
     49 
    1950#: contrib/comments/models/comments.py:8 
    2051#: contrib/comments/models/comments.py:161 
    21 #, fuzzy 
    2252msgid "object ID" 
    2353msgstr "Ukáž objekt id" 
     
    2959#: contrib/comments/models/comments.py:10 
    3060#: contrib/comments/models/comments.py:162 
    31 #, fuzzy 
    3261msgid "comment" 
    33 msgstr "obsah
     62msgstr "komentár
    3463 
    3564#: contrib/comments/models/comments.py:11 
     
    80109 
    81110#: contrib/comments/models/comments.py:26 contrib/admin/views/doc.py:274 
    82 #, fuzzy 
    83111msgid "IP address" 
    84112msgstr "IP adresa" 
     
    101129 
    102130#: contrib/comments/models/comments.py:32 
    103 #, fuzzy 
    104131msgid "Comments" 
    105132msgstr "Komentáre" 
     
    107134#: contrib/comments/models/comments.py:85 
    108135#: contrib/comments/models/comments.py:204 
    109 #, fuzzy 
    110136msgid "Content object" 
    111137msgstr "Obsah objectu" 
     
    127153 
    128154#: contrib/comments/models/comments.py:163 
    129 #, fuzzy 
    130155msgid "person's name" 
    131156msgstr "meno osoby" 
    132157 
    133158#: contrib/comments/models/comments.py:166 
    134 #, fuzzy 
    135159msgid "ip address" 
    136160msgstr "ip adresa" 
     
    141165 
    142166#: contrib/comments/models/comments.py:172 
    143 #, fuzzy 
    144167msgid "Free comment" 
    145168msgstr "Voľný komentár" 
    146169 
    147170#: contrib/comments/models/comments.py:173 
    148 #, fuzzy 
    149171msgid "Free comments" 
    150172msgstr "Voľné komentáre" 
     
    155177 
    156178#: contrib/comments/models/comments.py:210 
    157 #, fuzzy 
    158179msgid "score date" 
    159 msgstr "dátum konca platnosti
     180msgstr "údaje stavu
    160181 
    161182#: contrib/comments/models/comments.py:213 
     
    173194 
    174195#: contrib/comments/models/comments.py:248 
    175 #, fuzzy 
    176196msgid "flag date" 
    177197msgstr "návestie dátumu" 
    178198 
    179199#: contrib/comments/models/comments.py:251 
    180 #, fuzzy 
    181200msgid "User flag" 
    182201msgstr "Návestie uživateľa" 
    183202 
    184203#: contrib/comments/models/comments.py:252 
    185 #, fuzzy 
    186204msgid "User flags" 
    187205msgstr "Návestia užívateľa" 
     
    204222 
    205223#: contrib/comments/models/comments.py:278 
    206 #, fuzzy 
    207224msgid "deletion date" 
    208225msgstr "vymazaný dátum" 
     
    226243 
    227244#: contrib/comments/views/karma.py:22 
    228 #, fuzzy 
    229245msgid "Invalid comment ID" 
    230246msgstr "Neplatný komentár ID" 
     
    237253msgid "" 
    238254"This rating is required because you've entered at least one other rating." 
    239 msgstr "
     255msgstr "Toto hlasovanie je nevyhnutné, lebo súvisí s predchádzjúcou voľbou.
    240256"Táto voľba je nevyhnutná nakoľko je pokračovaním vašej predchádzajúcej." 
    241257 
     
    295311"invalid" 
    296312msgstr "Formulár kometára má chybný výstupný parameter -- objectID bol chybný" 
     313"Formulár komentára ma chybný 'cieľový' parameter  -- the objekt ID bol " 
     314"poškodený" 
    297315 
    298316#: contrib/comments/views/comments.py:254 
     
    533551 
    534552#: contrib/admin/views/doc.py:266 
    535 #, fuzzy 
    536553msgid "Date (without time)" 
    537554msgstr "Dátum (bez času)" 
    538555 
    539556#: contrib/admin/views/doc.py:267 
    540 #, fuzzy 
    541557msgid "Date (with time)" 
    542558msgstr "Dátum (a čas)" 
    543559 
    544560#: contrib/admin/views/doc.py:268 
    545 #, fuzzy 
    546561msgid "E-mail address" 
    547562msgstr "E-mailová adresa" 
     
    552567 
    553568#: contrib/admin/views/doc.py:270 
    554 #, fuzzy 
    555569msgid "Decimal number" 
    556570msgstr "Desiatkové číslo" 
     
    561575 
    562576#: contrib/admin/views/doc.py:277 
    563 #, fuzzy 
    564577msgid "Phone number" 
    565578msgstr "Číslo telefónu" 
     
    576589msgid "Time" 
    577590msgstr "Čas" 
    578  
    579 #: contrib/admin/views/doc.py:284 contrib/flatpages/models/flatpages.py:6 
    580 msgid "URL" 
    581 msgstr "URL" 
    582591 
    583592#: contrib/admin/views/doc.py:285 
     
    13071316#: models/auth.py:36 
    13081317msgid "e-mail address" 
    1309 msgstr "emailová adresa" 
     1318msgstr "e-mailová adresa" 
    13101319 
    13111320#: models/auth.py:37 
  • django/branches/new-admin/django/contrib/admin/templates/registration/password_reset_form.html

    r1070 r1408  
    88{% block content %} 
    99 
    10 <h1>{% trans "Password reset") }}</h1> 
     10<h1>{% trans "Password reset") %}</h1> 
    1111 
    1212<p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll reset your password and e-mail the new one to you." %}</p> 
  • django/branches/new-admin/django/core/template/loader.py

    r1375 r1408  
    6060    for loader in template_source_loaders: 
    6161        try: 
    62             source, display_name = loader(name, dirs) 
     62            source, display_name = loader(name, dirs) 
    6363            return (source, make_origin(display_name, loader, name, dirs)) 
    6464        except TemplateDoesNotExist: 
  • django/branches/new-admin/django/core/template/loaders/app_directories.py

    r1372 r1408  
    2828app_template_dirs = tuple(app_template_dirs) 
    2929 
     30def get_template_sources(template_name, template_dirs=None): 
     31    for template_dir in app_template_dirs: 
     32        yield os.path.join(template_dir, template_name) + TEMPLATE_FILE_EXTENSION 
     33 
    3034def load_template_source(template_name, template_dirs=None): 
    31     for template_dir in app_template_dirs: 
    32         filepath = os.path.join(template_dir, template_name) + TEMPLATE_FILE_EXTENSION 
     35    for filepath in get_template_sources(template_name, template_dirs): 
    3336        try: 
    3437            return (open(filepath).read(), filepath) 
  • django/branches/new-admin/django/core/template/loaders/filesystem.py

    r913 r1408  
    55import os 
    66 
    7 def load_template_source(template_name, template_dirs=None): 
     7def get_template_sources(template_name, template_dirs=None): 
    88    if not template_dirs: 
    99        template_dirs = TEMPLATE_DIRS 
     10    for template_dir in template_dirs: 
     11        yield os.path.join(template_dir, template_name) + TEMPLATE_FILE_EXTENSION 
     12 
     13def load_template_source(template_name, template_dirs=None): 
    1014    tried = [] 
    11     for template_dir in template_dirs: 
    12         filepath = os.path.join(template_dir, template_name) + TEMPLATE_FILE_EXTENSION 
     15    for filepath in get_template_sources(template_name, template_dirs): 
    1316        try: 
    1417            return (open(filepath).read(), filepath) 
  • django/branches/new-admin/django/models/auth.py

    r1361 r1408  
    3535    last_name = meta.CharField(_('last name'), maxlength=30, blank=True) 
    3636    email = meta.EmailField(_('e-mail address'), blank=True) 
    37     password = meta.CharField(_('password'), maxlength=128, help_text=_("Use '[algo]$[salt]$[hexdigest]")) 
     37    password = meta.CharField(_('password'), maxlength=128, help_text=_("Use '[algo]$[salt]$[hexdigest]'")) 
    3838    is_staff = meta.BooleanField(_('staff status'), help_text=_("Designates whether the user can log into this admin site.")) 
    3939    is_active = meta.BooleanField(_('active'), default=True) 
  • django/branches/new-admin/django/utils/translation.py

    r1269 r1408  
    365365constant_re = re.compile(r"""_\(((?:".*?")|(?:'.*?'))\)""") 
    366366def templateize(src): 
    367     from django.core.template import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK 
    368367    """ 
    369368    Turns a Django template into something that is understood by xgettext. It 
     
    371370    function invocations. 
    372371    """ 
     372    from django.core.template import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK 
    373373    out = StringIO() 
    374374    intrans = False 
  • django/branches/new-admin/django/views/debug.py

    r1386 r1408  
    11 
    22from django.conf import settings 
    3 from django.core.template import Template, Context 
     3from django.core.template import Template, Context, TemplateDoesNotExist 
    44from django.utils.html import escape 
    55from django.utils.httpwrappers import HttpResponseServerError, HttpResponseNotFound 
     
    1111 
    1212def linebreak_iter(template_source): 
     13    yield 0 
    1314    p = template_source.find('\n') 
    1415    while p >= 0: 
    15         yield p 
     16        yield p+1 
    1617        p = template_source.find('\n', p+1) 
    1718    yield len(template_source) + 1 
     
    2425    upto = 0 
    2526    source_lines = [] 
    26     linebreaks = izip(count(0), linebreak_iter(template_source)) 
    27     linebreaks.next() # skip the nothing before initial line start 
    28     for num, next in linebreaks: 
     27    for num, next in enumerate(linebreak_iter(template_source)): 
    2928        if start >= upto and end <= next: 
    3029            line = num 
    3130            before = escape(template_source[upto:start]) 
    3231            during = escape(template_source[start:end]) 
    33             after = escape(template_source[end:next - 1]) 
    34         source_lines.append( (num, escape(template_source[upto:next - 1])) ) 
     32            after = escape(template_source[end:next]) 
     33        source_lines.append( (num, escape(template_source[upto:next])) ) 
    3534        upto = next 
    3635    total = len(source_lines) 
    3736 
    38     top = max(0, line - context_lines) 
     37    top = max(1, line - context_lines) 
    3938    bottom = min(total, line + 1 + context_lines) 
    4039 
     
    4544        'during': during, 
    4645        'after': after, 
    47         'top': top
    48         'bottom': bottom
     46        'top': top
     47        'bottom': bottom
    4948        'total': total, 
    5049        'line': line, 
     
    6059    """ 
    6160    template_info = None 
     61    template_does_not_exist = False 
     62    loader_debug_info = None 
     63    if issubclass(exc_type, TemplateDoesNotExist): 
     64        from django.core.template.loader import template_source_loaders 
     65        template_does_not_exist = True 
     66        loader_debug_info = [] 
     67        for loader in template_source_loaders: 
     68            try: 
     69                source_list_func = getattr(__import__(loader.__module__, '', '', ['get_template_sources']), 'get_template_sources') 
     70                # NOTE: This assumes exc_value is the name of the template that 
     71                # the loader attempted to load. 
     72                template_list = [{'name': t, 'exists': os.path.exists(t)} \ 
     73                    for t in source_list_func(str(exc_value))] 
     74            except (ImportError, AttributeError): 
     75                template_list = [] 
     76            loader_debug_info.append({ 
     77                'loader': loader.__module__ + '.' + loader.__name__, 
     78                'templates': template_list, 
     79            }) 
    6280    if settings.TEMPLATE_DEBUG and hasattr(exc_value, 'source'): 
    6381        exc_type, exc_value, tb, template_info = get_template_exception_info(exc_type, exc_value, tb) 
     
    102120        'settings': settings_dict, 
    103121        'template_info': template_info, 
     122        'template_does_not_exist': template_does_not_exist, 
     123        'loader_debug_info': loader_debug_info, 
    104124    }) 
    105125    return HttpResponseServerError(t.render(c), mimetype='text/html') 
     
    189209    #summary h2 { font-weight: normal; color: #666; } 
    190210    #explanation { background:#eee; } 
    191     #template { background:#f6f6f6; } 
     211    #template, #template-not-exist { background:#f6f6f6; } 
     212    #template-not-exist ul { margin: 0 0 0 20px; } 
    192213    #traceback { background:#eee; } 
    193214    #requestinfo { background:#f6f6f6; padding-left:120px; } 
     
    274295  </table> 
    275296</div> 
     297{% if template_does_not_exist %} 
     298<div id="template-not-exist"> 
     299    <h2>Template-loader postmortem</h2> 
     300    {% if loader_debug_info %} 
     301        <p>Django tried loading these templates, in this order:</p> 
     302        <ul> 
     303        {% for loader in loader_debug_info %} 
     304            <li>Using loader <code>{{ loader.loader }}</code>: 
     305                <ul>{% for t in loader.templates %}<li><code>{{ t.name }}</code> (File {% if t.exists %}exists{% else %}does not exist{% endif %})</li>{% endfor %}</ul> 
     306            </li> 
     307        {% endfor %} 
     308        </ul> 
     309    {% else %} 
     310        <p>Django couldn't find any templates because your <code>TEMPLATE_LOADERS</code> setting is empty!</p> 
     311    {% endif %} 
     312</div> 
     313{% endif %} 
    276314{% if template_info %} 
    277315<div id="template"> 
     
    286324   {% else %} 
    287325      <tr><th>{{ source_line.0 }}</th> 
    288       <td> {{ source_line.1 }}</td></tr> 
     326      <td>{{ source_line.1 }}</td></tr> 
    289327   {% endifequal %} 
    290328   {% endfor %} 
  • django/branches/new-admin/django/views/registration/passwords.py

    r876 r1408  
    4242            'user': self.user_cache, 
    4343        } 
    44         send_mail('Password reset on %s' % site_name, t.render(c), None, [self.user_cache.email]) 
     44        send_mail('Password reset on %s' % site_name, t.render(Context(c)), None, [self.user_cache.email]) 
    4545 
    4646class PasswordChangeForm(formfields.Manipulator): 
  • django/branches/new-admin/django/views/static.py

    r1361 r1408  
    3535            # strip '.' amd '..' in path 
    3636            continue 
    37         newpath = os.path.join(newpath, part) 
     37        newpath = os.path.join(newpath, part).replace('\\', '/') 
    3838    if newpath and path != newpath: 
    3939        return HttpResponseRedirect(newpath)