mirror of
				https://github.com/django/django.git
				synced 2025-10-30 17:16:10 +00:00 
			
		
		
		
	magic-removal: Removed _get_packages_insert() from django.core.management
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2464 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		| @@ -26,12 +26,6 @@ PROJECT_TEMPLATE_DIR = os.path.join(django.__path__[0], 'conf', '%s_template') | |||||||
|  |  | ||||||
| INVALID_PROJECT_NAMES = ('django', 'test') | INVALID_PROJECT_NAMES = ('django', 'test') | ||||||
|  |  | ||||||
| def _get_packages_insert(app_label): |  | ||||||
|     from django.db import backend |  | ||||||
|     return "INSERT INTO %s (%s, %s) VALUES ('%s', '%s');" % \ |  | ||||||
|         (backend.quote_name('django_package'), backend.quote_name('label'), backend.quote_name('name'), |  | ||||||
|         app_label, app_label) |  | ||||||
|  |  | ||||||
| def _get_permission_codename(action, opts): | def _get_permission_codename(action, opts): | ||||||
|     return '%s_%s' % (action, opts.object_name.lower()) |     return '%s_%s' % (action, opts.object_name.lower()) | ||||||
|  |  | ||||||
| @@ -65,7 +59,7 @@ def get_version(): | |||||||
|     if VERSION[3]: |     if VERSION[3]: | ||||||
|         v += ' (%s)' % VERSION[3] |         v += ' (%s)' % VERSION[3] | ||||||
|     return v |     return v | ||||||
|      |  | ||||||
| def get_sql_create(app): | def get_sql_create(app): | ||||||
|     "Returns a list of the CREATE TABLE SQL statements for the given app." |     "Returns a list of the CREATE TABLE SQL statements for the given app." | ||||||
|     from django.db import get_creation_module, models |     from django.db import get_creation_module, models | ||||||
| @@ -104,12 +98,12 @@ get_sql_create.args = APP_ARGS | |||||||
| def _get_sql_model_create(klass, models_already_seen=set()): | def _get_sql_model_create(klass, models_already_seen=set()): | ||||||
|     """ |     """ | ||||||
|     Get the SQL required to create a single model. |     Get the SQL required to create a single model. | ||||||
|      |  | ||||||
|     Returns list_of_sql, pending_references_dict |     Returns list_of_sql, pending_references_dict | ||||||
|     """ |     """ | ||||||
|     from django.db import backend, get_creation_module, models |     from django.db import backend, get_creation_module, models | ||||||
|     data_types = get_creation_module().DATA_TYPES |     data_types = get_creation_module().DATA_TYPES | ||||||
|      |  | ||||||
|     opts = klass._meta |     opts = klass._meta | ||||||
|     final_output = [] |     final_output = [] | ||||||
|     table_output = [] |     table_output = [] | ||||||
| @@ -151,7 +145,7 @@ def _get_sql_model_create(klass, models_already_seen=set()): | |||||||
|         full_statement.append('    %s%s' % (line, i < len(table_output)-1 and ',' or '')) |         full_statement.append('    %s%s' % (line, i < len(table_output)-1 and ',' or '')) | ||||||
|     full_statement.append(');') |     full_statement.append(');') | ||||||
|     final_output.append('\n'.join(full_statement)) |     final_output.append('\n'.join(full_statement)) | ||||||
|      |  | ||||||
|     return final_output, pending_references |     return final_output, pending_references | ||||||
|  |  | ||||||
| def _get_sql_for_pending_references(klass, pending_references): | def _get_sql_for_pending_references(klass, pending_references): | ||||||
| @@ -160,7 +154,7 @@ def _get_sql_for_pending_references(klass, pending_references): | |||||||
|     """ |     """ | ||||||
|     from django.db import backend, get_creation_module |     from django.db import backend, get_creation_module | ||||||
|     data_types = get_creation_module().DATA_TYPES |     data_types = get_creation_module().DATA_TYPES | ||||||
|      |  | ||||||
|     final_output = [] |     final_output = [] | ||||||
|     if backend.supports_constraints: |     if backend.supports_constraints: | ||||||
|         opts = klass._meta |         opts = klass._meta | ||||||
| @@ -399,11 +393,11 @@ def syncdb(): | |||||||
|     data_types = get_creation_module().DATA_TYPES |     data_types = get_creation_module().DATA_TYPES | ||||||
|  |  | ||||||
|     cursor = connection.cursor() |     cursor = connection.cursor() | ||||||
|      |  | ||||||
|     # Get a list of all existing database tables, |     # Get a list of all existing database tables, | ||||||
|     # so we know what needs to be added. |     # so we know what needs to be added. | ||||||
|     table_list = introspection_module.get_table_list(cursor) |     table_list = introspection_module.get_table_list(cursor) | ||||||
|      |  | ||||||
|     # Get a list of already installed *models* so that references work right. |     # Get a list of already installed *models* so that references work right. | ||||||
|     all_models = [] |     all_models = [] | ||||||
|     for app in models.get_apps(): |     for app in models.get_apps(): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user