mirror of
https://github.com/django/django.git
synced 2025-03-11 09:52:38 +00:00
Modified sql_index function names to match pattern established by initial_data functions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3894 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
f5087775b3
commit
8f91717c82
@ -401,12 +401,12 @@ def get_sql_indexes(app):
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
output = []
|
output = []
|
||||||
for model in models.get_models(app):
|
for model in models.get_models(app):
|
||||||
output.extend(_get_sql_index(model))
|
output.extend(get_sql_indexes_for_model(model))
|
||||||
return output
|
return output
|
||||||
get_sql_indexes.help_doc = "Prints the CREATE INDEX SQL statements for the given model module name(s)."
|
get_sql_indexes.help_doc = "Prints the CREATE INDEX SQL statements for the given model module name(s)."
|
||||||
get_sql_indexes.args = APP_ARGS
|
get_sql_indexes.args = APP_ARGS
|
||||||
|
|
||||||
def _get_sql_index(model):
|
def get_sql_indexes_for_model(model):
|
||||||
"Returns the CREATE INDEX SQL statements for a single model"
|
"Returns the CREATE INDEX SQL statements for a single model"
|
||||||
from django.db import backend
|
from django.db import backend
|
||||||
output = []
|
output = []
|
||||||
@ -527,7 +527,7 @@ def syncdb(verbosity=1, interactive=True):
|
|||||||
app_name = app.__name__.split('.')[-2]
|
app_name = app.__name__.split('.')[-2]
|
||||||
for model in models.get_models(app):
|
for model in models.get_models(app):
|
||||||
if model in created_models:
|
if model in created_models:
|
||||||
index_sql = _get_sql_index(model)
|
index_sql = get_sql_indexes_for_model(model)
|
||||||
if index_sql:
|
if index_sql:
|
||||||
if verbosity >= 1:
|
if verbosity >= 1:
|
||||||
print "Installing index for %s.%s model" % (app_name, model._meta.object_name)
|
print "Installing index for %s.%s model" % (app_name, model._meta.object_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user