Skip to content

Commit

Permalink
Merge branch 'master' into q-predicate
Browse files Browse the repository at this point in the history
Conflicts:
	django/db/models/sql/query.py
	updates location of lookup_sep constant
  • Loading branch information
ptone committed Sep 9, 2012
2 parents b90bbe1 + 2e92858 commit 9a2febc
Show file tree
Hide file tree
Showing 67 changed files with 1,197 additions and 586 deletions.
1 change: 1 addition & 0 deletions AUTHORS
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
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
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'

0 comments on commit 9a2febc

Please sign in to comment.