diff --git a/django/core/management.py b/django/core/management.py index a8931de544..6314ca6ac0 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -264,7 +264,7 @@ database_check.args = APP_ARGS def get_admin_index(mod): "Returns admin-index template snippet (in list form) for the given module." - from django.core import meta + from django.utils.text import capfirst output = [] app_label = mod._MODELS[0]._meta.app_label output.append('{%% if perms.%s %%}' % app_label) @@ -274,7 +274,7 @@ def get_admin_index(mod): output.append(MODULE_TEMPLATE % { 'app': app_label, 'mod': klass._meta.module_name, - 'name': meta.capfirst(klass._meta.verbose_name_plural), + 'name': capfirst(klass._meta.verbose_name_plural), 'addperm': klass._meta.get_add_permission(), 'changeperm': klass._meta.get_change_permission(), }) diff --git a/django/core/meta.py b/django/core/meta/__init__.py similarity index 71% rename from django/core/meta.py rename to django/core/meta/__init__.py index 98ce768f72..20b5ee6863 100644 --- a/django/core/meta.py +++ b/django/core/meta/__init__.py @@ -1,30 +1,20 @@ +from django.conf import settings from django.core import formfields, validators from django.core import db from django.core.exceptions import ObjectDoesNotExist -from django.conf import settings +from django.core.meta.fields import * +from django.utils.functional import curry +from django.utils.text import capfirst import copy, datetime, os, re, sys, types -# The values to use for "blank" in SelectFields. Will be appended to the start of most "choices" lists. -BLANK_CHOICE_DASH = [("", "---------")] -BLANK_CHOICE_NONE = [("", "None")] - # Admin stages. ADD, CHANGE, BOTH = 1, 2, 3 -# Values for Relation.edit_inline_type. -TABULAR, STACKED = 1, 2 - -# Values for filter_interface. -HORIZONTAL, VERTICAL = 1, 2 - -# Random entropy string used by "default" param. -NOT_PROVIDED = 'oijpwojefiojpanv' - # Size of each "chunk" for get_iterator calls. # Larger values are slightly faster at the expense of more storage space. GET_ITERATOR_CHUNK_SIZE = 100 -# Prefix (in python path style) to location of models. +# Prefix (in Python path style) to location of models. MODEL_PREFIX = 'django.models' # Methods on models with the following prefix will be removed and @@ -37,21 +27,10 @@ MANIPULATOR_FUNCTIONS_PREFIX = '_manipulator_' LOOKUP_SEPARATOR = '__' -RECURSIVE_RELATIONSHIP_CONSTANT = 'self' - #################### # HELPER FUNCTIONS # #################### -# capitalizes first letter of string -capfirst = lambda x: x and x[0].upper() + x[1:] - -# prepares a value for use in a LIKE query -prep_for_like_query = lambda x: str(x).replace("%", "\%").replace("_", "\_") - -# returns the