summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoulder Sprinters <boulder-sprinters@djangoproject.com>2007-04-19 21:17:29 +0000
committerBoulder Sprinters <boulder-sprinters@djangoproject.com>2007-04-19 21:17:29 +0000
commit557a0d407c9479d61c20ba9f323b7f4d5c17a2b5 (patch)
treee528f8f0cbd9949f9d119418e3195633dc0872a1
parent1ad6a8f5c1509d20fcebcb45f40410c23baae493 (diff)
downloaddjango-557a0d407c9479d61c20ba9f323b7f4d5c17a2b5.tar.gz
boulder-oracle-sprint: Renamed the "tablespace" options to "db_tablespace".
git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@5036 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/management.py16
-rw-r--r--django/db/models/fields/__init__.py4
-rw-r--r--django/db/models/options.py4
3 files changed, 12 insertions, 12 deletions
diff --git a/django/core/management.py b/django/core/management.py
index 880ab5055f..8e86e6b6ba 100644
--- a/django/core/management.py
+++ b/django/core/management.py
@@ -178,7 +178,7 @@ def _get_sql_model_create(model, known_models=set()):
rel_field = f
data_type = f.get_internal_type()
col_type = data_types[data_type]
- tablespace = f.tablespace or opts.tablespace
+ tablespace = f.db_tablespace or opts.db_tablespace
if col_type is not None:
# Make the definition (e.g. 'foo VARCHAR(30)') for this field.
field_output = [style.SQL_FIELD(backend.quote_name(f.column)),
@@ -216,8 +216,8 @@ def _get_sql_model_create(model, known_models=set()):
for i, line in enumerate(table_output): # Combine and add commas.
full_statement.append(' %s%s' % (line, i < len(table_output)-1 and ',' or ''))
full_statement.append(')')
- if opts.tablespace and backend.supports_tablespaces:
- full_statement.append(backend.get_tablespace_sql(opts.tablespace))
+ if opts.db_tablespace and backend.supports_tablespaces:
+ full_statement.append(backend.get_tablespace_sql(opts.db_tablespace))
full_statement.append(';')
final_output.append('\n'.join(full_statement))
@@ -266,7 +266,7 @@ def _get_many_to_many_sql_for_model(model):
final_output = []
for f in opts.many_to_many:
if not isinstance(f.rel, GenericRel):
- tablespace = f.tablespace or opts.tablespace
+ tablespace = f.db_tablespace or opts.db_tablespace
if tablespace and backend.supports_tablespaces and backend.autoindexes_primary_keys:
tablespace_sql = ' ' + backend.get_tablespace_sql(tablespace, inline=True)
else:
@@ -298,9 +298,9 @@ def _get_many_to_many_sql_for_model(model):
style.SQL_FIELD(backend.quote_name(f.m2m_reverse_name())),
tablespace_sql))
table_output.append(')')
- if opts.tablespace and backend.supports_tablespaces:
- # f.tablespace is only for indices, so ignore its value here.
- table_output.append(backend.get_tablespace_sql(opts.tablespace))
+ if opts.db_tablespace and backend.supports_tablespaces:
+ # f.db_tablespace is only for indices, so ignore its value here.
+ table_output.append(backend.get_tablespace_sql(opts.db_tablespace))
table_output.append(';')
final_output.append('\n'.join(table_output))
@@ -483,7 +483,7 @@ def get_sql_indexes_for_model(model):
for f in model._meta.fields:
if f.db_index and not ((f.primary_key or f.unique) and backend.autoindexes_primary_keys):
unique = f.unique and 'UNIQUE ' or ''
- tablespace = f.tablespace or model._meta.tablespace
+ tablespace = f.db_tablespace or model._meta.db_tablespace
if tablespace and backend.supports_tablespaces:
tablespace_sql = ' ' + backend.get_tablespace_sql(tablespace)
else:
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index ff85ca6c5b..32624fa7a4 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -70,7 +70,7 @@ class Field(object):
core=False, rel=None, default=NOT_PROVIDED, editable=True, serialize=True,
prepopulate_from=None, unique_for_date=None, unique_for_month=None,
unique_for_year=None, validator_list=None, choices=None, radio_admin=None,
- help_text='', db_column=None, tablespace=None):
+ help_text='', db_column=None, db_tablespace=None):
self.name = name
self.verbose_name = verbose_name
self.primary_key = primary_key
@@ -87,7 +87,7 @@ class Field(object):
self.radio_admin = radio_admin
self.help_text = help_text
self.db_column = db_column
- self.tablespace = tablespace
+ self.db_tablespace = db_tablespace
# Set db_index to True if the field has a relationship and doesn't explicitly set db_index.
self.db_index = db_index
diff --git a/django/db/models/options.py b/django/db/models/options.py
index 79f22384dc..88e2d88a46 100644
--- a/django/db/models/options.py
+++ b/django/db/models/options.py
@@ -13,7 +13,7 @@ get_verbose_name = lambda class_name: re.sub('(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|
DEFAULT_NAMES = ('verbose_name', 'db_table', 'ordering',
'unique_together', 'permissions', 'get_latest_by',
- 'order_with_respect_to', 'app_label', 'tablespace')
+ 'order_with_respect_to', 'app_label', 'db_tablespace')
class Options(object):
def __init__(self, meta):
@@ -27,7 +27,7 @@ class Options(object):
self.object_name, self.app_label = None, None
self.get_latest_by = None
self.order_with_respect_to = None
- self.tablespace = None
+ self.db_tablespace = None
self.admin = None
self.meta = meta
self.pk = None