Skip to content

Commit

Permalink
Merge branch 'master' of github.com:brad/django into ticket_18903
Browse files Browse the repository at this point in the history
  • Loading branch information
brad committed Sep 12, 2012
2 parents 8c08fca + fbd4b3a commit d85f73a
Show file tree
Hide file tree
Showing 157 changed files with 1,978 additions and 1,454 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ answer newbie questions, and generally made Django that much better:
Johan C. Stöver <johan@nilling.nl>
Nowell Strite <http://nowell.strite.org/>
Thomas Stromberg <tstromberg@google.com>
Travis Swicegood <travis@domain51.com>
Pascal Varet
SuperJared
Radek Švarz <http://www.svarz.cz/translate/>
Expand Down
18 changes: 13 additions & 5 deletions django/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"""

import os
import re
import time # Needed for Windows
import warnings

Expand All @@ -26,7 +25,7 @@ class LazySettings(LazyObject):
The user can manually configure settings prior to using them. Otherwise,
Django uses the settings module pointed to by DJANGO_SETTINGS_MODULE.
"""
def _setup(self):
def _setup(self, name):
"""
Load the settings module pointed to by the environment variable. This
is used the first time we need any settings at all, if the user has not
Expand All @@ -37,12 +36,21 @@ def _setup(self):
if not settings_module: # If it's set but is an empty string.
raise KeyError
except KeyError:
# NOTE: This is arguably an EnvironmentError, but that causes
# problems with Python's interactive help.
raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)
raise ImproperlyConfigured(
"Requested setting %s, but settings are not configured. "
"You must either define the environment variable %s "
"or call settings.configure() before accessing settings."
% (name, ENVIRONMENT_VARIABLE))

self._wrapped = Settings(settings_module)


def __getattr__(self, name):
if self._wrapped is empty:
self._setup(name)
return getattr(self._wrapped, name)


def configure(self, default_settings=global_settings, **options):
"""
Called to manually configure the settings. The 'default_settings'
Expand Down
5 changes: 4 additions & 1 deletion django/contrib/admin/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from django.db import models, transaction, router
from django.db.models.constants import LOOKUP_SEP
from django.db.models.related import RelatedObject
from django.db.models.fields import BLANK_CHOICE_DASH, FieldDoesNotExist
from django.db.models.sql.constants import LOOKUP_SEP, QUERY_TERMS
from django.db.models.sql.constants import QUERY_TERMS
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.template.response import SimpleTemplateResponse, TemplateResponse
Expand Down Expand Up @@ -1456,8 +1457,10 @@ def has_delete_permission(self, request, obj=None):
return request.user.has_perm(
self.opts.app_label + '.' + self.opts.get_delete_permission())


class StackedInline(InlineModelAdmin):
template = 'admin/edit_inline/stacked.html'


class TabularInline(InlineModelAdmin):
template = 'admin/edit_inline/tabular.html'
Loading

0 comments on commit d85f73a

Please sign in to comment.