Django

Code

Changeset 6801

Show
Ignore:
Timestamp:
12/01/07 13:23:49 (9 months ago)
Author:
ikelly
Message:

Fixed #6007: Added DEFAULT_TABLESPACE and DEFAULT_INDEX_TABLESPACE
options to global_settings.py

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/conf/global_settings.py

    r6701 r6801  
    254254URL_VALIDATOR_USER_AGENT = "Django/%s (http://www.djangoproject.com)" % get_version() 
    255255 
     256# The tablespaces to use for each model when not specified otherwise. 
     257DEFAULT_TABLESPACE = '' 
     258DEFAULT_INDEX_TABLESPACE = '' 
     259 
    256260############## 
    257261# MIDDLEWARE # 
  • django/trunk/django/db/models/fields/__init__.py

    r6733 r6801  
    105105        self.help_text = help_text 
    106106        self.db_column = db_column 
    107         self.db_tablespace = db_tablespace 
     107        self.db_tablespace = db_tablespace or settings.DEFAULT_INDEX_TABLESPACE 
    108108 
    109109        # Set db_index to True if the field has a relationship and doesn't explicitly set db_index. 
  • django/trunk/django/db/models/options.py

    r6213 r6801  
    3030        self.get_latest_by = None 
    3131        self.order_with_respect_to = None 
    32         self.db_tablespace = None 
     32        self.db_tablespace = settings.DEFAULT_TABLESPACE 
    3333        self.admin = None 
    3434        self.meta = meta 
  • django/trunk/docs/databases.txt

    r6763 r6801  
    259259it would be stored in the model tablespace ``tables`` by default. 
    260260 
     261The settings.py file supports two additional options to specify 
     262default values for the db_tablespace options. This is useful for 
     263setting a tablespace for the Django internal apps and other 
     264contributed applications.  These options are ``DEFAULT_TABLESPACE`` 
     265and ``DEFAULT_INDEX_TABLESPACE``. 
     266 
    261267Django does not create the tablespaces for you. Please refer to `Oracle's 
    262268documentation`_ for details on creating and managing tablespaces. 
  • django/trunk/docs/model-api.txt

    r6743 r6801  
    619619 
    620620The name of the database tablespace to use for this field's index, if 
    621 indeed this field is indexed. The default is the ``db_tablespace`` of 
    622 the model, if any. If the backend doesn't support tablespaces, this 
     621indeed this field is indexed. The default is the project's 
     622``DEFAULT_INDEX_TABLESPACE`` setting, if set, or the ``db_tablespace`` 
     623of the model, if any. If the backend doesn't support tablespaces, this 
    623624option is ignored. 
    624625 
  • django/trunk/docs/settings.txt

    r6791 r6801  
    404404Default e-mail address to use for various automated correspondence from the 
    405405site manager(s). 
     406 
     407DEFAULT_TABLESPACE 
     408------------------ 
     409 
     410Default: ``''`` (Empty string) 
     411 
     412Default tablespace to use for models that do not specify one, if the 
     413backend supports it. 
     414 
     415DEFAULT_INDEX_TABLESPACE 
     416------------------------ 
     417 
     418Default: ``''`` (Empty string) 
     419 
     420Default tablespace to use for indexes on fields that do not specify 
     421one, if the backend supports it. 
    406422 
    407423DISALLOWED_USER_AGENTS