summaryrefslogtreecommitdiff
path: root/django/db/models/options.py
Commit message (Collapse)AuthorAgeFilesLines
* [soc2010/app-loading] implement APP_CLASSES settingArthur Koziel2010-09-121-1/+7
| | | | git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/app-loading@13759 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* [soc2010/app-loading] use the db_prefix attribute to create database tablesArthur Koziel2010-08-151-2/+4
| | | | git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/app-loading@13593 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #12164 -- Removed the Python 2.3 compatibility imports and ↵Russell Keith-Magee2010-05-041-4/+0
| | | | | | workarounds. Thanks to timo and claudep for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13094 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #13328 -- Ensured that querysets on models with callable defaults can ↵Russell Keith-Magee2010-04-211-3/+1
| | | | | | be pickled. No, really this time. Thanks to Alex for his help brainstorming the solution. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13013 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #13328 -- Added a __getstate__/__setstate__ pair to fields so that ↵Russell Keith-Magee2010-04-151-2/+2
| | | | | | callable default values aren't pickled. Thanks to bkonkle for the report, and Vitaly Babiy for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12977 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Changed a whole bunch of places to raise exception instances instead of ↵Adrian Holovaty2010-01-101-2/+2
| | | | | | old-style raising exception classes plus a comma. Good for the future Python 3 conversion git-svn-id: http://code.djangoproject.com/svn/django/trunk@12180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #10109 -- Removed the use of raw SQL in many-to-many fields by ↵Russell Keith-Magee2009-11-031-2/+2
| | | | | | | | introducing an autogenerated through model. This is the first part of Alex Gaynor's GSoC project to add Multi-db support to Django. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11710 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #10953, #10955: proxies of proxies now work correctly, though I still ↵Jacob Kaplan-Moss2009-05-111-2/+7
| | | | | | don't quite understand why you'd want to do such a thing. Thanks, Armin Ronacher. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10738 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5420 -- Added support for delayed loading of model fields.Malcolm Tredinnick2009-03-191-0/+6
| | | | | | | | | | In extreme cases, some fields are expensive to load from the database (e.g. GIS fields requiring conversion, or large text fields). This commit adds defer() and only() methods to querysets that allow the caller to specify which fields should not be loaded unless they are accessed. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10090 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #10356 -- Added pure-Python inheritance for models (a.k.a proxy models).Malcolm Tredinnick2009-03-181-3/+16
| | | | | | | | | Large portions of this are needed for #5420, so I implemented it fully. Thanks to Ryan Kelly for an initial patch to get this started. Refs #5420. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10083 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3163 -- Add a "Meta.managed" option to models.Malcolm Tredinnick2009-03-091-1/+2
| | | | | | | | | | | This allows a model to be defined which is not subject to database table creation and removal. Useful for models that sit over existing tables or database views. Thanks to Alexander Myodov, Wolfgang Kriesing and Ryan Kelly for the bulk of this patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10008 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #10251 -- Fixed model inheritance when there's also an explicit pk field.Malcolm Tredinnick2009-03-041-0/+15
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@9970 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Removed django.db.models.options.Options.one_to_one_field.Malcolm Tredinnick2008-12-111-1/+0
| | | | | | | | | The last use of it was removed in r9641 (it's internal API) and it's been broken since r7477, as there's no longer a maximum of one OneToOneField per model, so anything relying on it contained subtle bugs. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9643 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* The first step in fixing a group of problems related to outputting a properMalcolm Tredinnick2008-12-081-0/+1
| | | | | | | | | | "value" for a field that is a relation to another model. This part adds the utility method on Model that should help in general.Also cleans up the slightly ugly mess from r8957. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9601 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #8309: subclasses now inherit `GenericForeignKey` correctly. There's ↵Jacob Kaplan-Moss2008-09-021-0/+4
| | | | | | also now an internal API so that other "virtual fields" like GFK can be inherited as well. Thanks, msaelices. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8855 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #7154 -- Inherit all model managers from abstract base classes.Malcolm Tredinnick2008-09-021-0/+3
| | | | | | | | | Also added documentation describing how manager inheritance works (and when manager aren't inherited). Based on some patches from sebastian_noack and emulbreh. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8851 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* [8721] introduced some internal field names. We hide them from the list ofMalcolm Tredinnick2008-08-301-2/+6
| | | | | | | valid field names in debugging output so that it doesn't confuse things. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8730 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Removed oldforms, validators, and related code:Gary Wilson Jr2008-08-271-47/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | * Removed `Manipulator`, `AutomaticManipulator`, and related classes. * Removed oldforms specific bits from model fields: * Removed `validator_list` and `core` arguments from constructors. * Removed the methods: * `get_manipulator_field_names` * `get_manipulator_field_objs` * `get_manipulator_fields` * `get_manipulator_new_data` * `prepare_field_objs_and_params` * `get_follow` * Renamed `flatten_data` method to `value_to_string` for better alignment with its use by the serialization framework, which was the only remaining code using `flatten_data`. * Removed oldforms methods from `django.db.models.Options` class: `get_followed_related_objects`, `get_data_holders`, `get_follow`, and `has_field_type`. * Removed oldforms-admin specific options from `django.db.models.fields.related` classes: `num_in_admin`, `min_num_in_admin`, `max_num_in_admin`, `num_extra_on_change`, and `edit_inline`. * Serialization framework * `Serializer.get_string_value` now calls the model fields' renamed `value_to_string` methods. * Removed a special-casing of `models.DateTimeField` in `core.serializers.base.Serializer.get_string_value` that's handled by `django.db.models.fields.DateTimeField.value_to_string`. * Removed `django.core.validators`: * Moved `ValidationError` exception to `django.core.exceptions`. * For the couple places that were using validators, brought over the necessary code to maintain the same functionality. * Introduced a SlugField form field for validation and to compliment the SlugField model field (refs #8040). * Removed an oldforms-style model creation hack (refs #2160). git-svn-id: http://code.djangoproject.com/svn/django/trunk@8616 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Merged the newforms-admin branch into trunk.Brian Rosner2008-07-181-75/+0
| | | | | | | | This is a backward incompatible change. The admin contrib app has been refactored. The newforms module has several improvements including FormSets and Media definitions. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7967 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed handling of multiple fields in a model pointing to the same related model.Malcolm Tredinnick2008-06-291-0/+19
| | | | | | | Thanks to ElliotM, mk and oyvind for some excellent test cases for this. Fixed #7110, #7125. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7778 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Moved the settings of db_table to Options.contribute_to_class().Malcolm Tredinnick2008-06-291-9/+11
| | | | | | | | | Some fields need to know the right db_table setting in their own contribute_to_class(), so waiting until Options._prepare() is a little inconvenient. This is a deep-internals change. No effect on external code. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7777 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed the way symmetrical many-to-many relations are recorded in the Options ↵Malcolm Tredinnick2008-06-261-4/+7
| | | | | | | | | | class. These types of relations don't have reverse accessor names, so that name can be used by a normal field on the model. Fixed #7107. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7764 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #7350, #7202 -- Fixed serialization for multi-model inheritance, which ↵Russell Keith-Magee2008-06-091-1/+1
| | | | | | | | | | had multiple problems: * Serializers were including all superclass fields in their output. Now only local fields are included. * Implicit OneToOne primary keys were not correctly added to the metamodel, so they were always marked to be serialized, even though they were primary * Model saving was too aggressive about creating new parent class instances during deserialization. Raw save on a model now skips saving of the parent class. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7600 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #7342: Ignore any Meta options starting with '_', thus making it OK ↵Jacob Kaplan-Moss2008-06-071-2/+6
| | | | | | for Meta to be a newstyle class. Thanks, Gulopine. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7585 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* When retrieving a field by name, handle a missed case when the cache cannot beMalcolm Tredinnick2008-04-271-1/+1
| | | | | | | initialised yet. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7478 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Merged the queryset-refactor branch into trunk.Malcolm Tredinnick2008-04-271-45/+273
| | | | | | | | | | This is a big internal change, but mostly backwards compatible with existing code. Also adds a couple of new features. Fixed #245, #1050, #1656, #1801, #2076, #2091, #2150, #2253, #2306, #2400, #2430, #2482, #2496, #2676, #2737, #2874, #2902, #2939, #3037, #3141, #3288, #3440, #3592, #3739, #4088, #4260, #4289, #4306, #4358, #4464, #4510, #4858, #5012, #5020, #5261, #5295, #5321, #5324, #5325, #5555, #5707, #5796, #5817, #5987, #6018, #6074, #6088, #6154, #6177, #6180, #6203, #6658 git-svn-id: http://code.djangoproject.com/svn/django/trunk@7477 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3323 -- More robust error handling for related objetcs. Thanks, GregMalcolm Tredinnick2007-12-021-2/+2
| | | | | | | Kopka and shaleh. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6835 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #6007: Added DEFAULT_TABLESPACE and DEFAULT_INDEX_TABLESPACE Ian Kelly2007-12-011-1/+1
| | | | | | | options to global_settings.py git-svn-id: http://code.djangoproject.com/svn/django/trunk@6801 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5460 -- unique_together now accepts a single tuple for convenience. ↵Adrian Holovaty2007-09-141-0/+10
| | | | | | Thanks, Deryck Hodge git-svn-id: http://code.djangoproject.com/svn/django/trunk@6213 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5218: Made Oracle create autoinc triggers using the correct name Ian Kelly2007-09-141-1/+1
| | | | | | | of the AutoField column rather than always assume "ID". git-svn-id: http://code.djangoproject.com/svn/django/trunk@6195 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Refactored get_max_name_length() to DatabaseOperations.max_name_length(). ↵Adrian Holovaty2007-08-191-3/+2
| | | | | | Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5960 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Renamed Cache to AppCache and cache_ready() to app_cache_ready() from [5919] ↵Malcolm Tredinnick2007-08-181-2/+2
| | | | | | in order to avoid any potential confusion with Django's caching middleware functionality when reading the code. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5922 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Rewrote portions of the app- and model-cache initialisation to handle some ↵Malcolm Tredinnick2007-08-171-2/+3
| | | | | | | | | | | corner cases. It is now possible to use m2m relations before everything is imported and still get the right results later when importing is complete. Also, get_apps() should always return the same results, so apps won't randomly disappear in the admin interface. Also reorganised the structure of loading.py, since the number of global variables was exploding. The public API is still backwards compatible. Fixed #1796 and #2438 (he claims, optimistically). git-svn-id: http://code.djangoproject.com/svn/django/trunk@5919 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Merged Unicode branch into trunk (r4952:5608). This should be fullyMalcolm Tredinnick2007-07-041-3/+19
| | | | | | | | | backwards compatible for all practical purposes. Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Merged boulder-oracle-sprint branch (r3965:5512) back into trunk. AllMalcolm Tredinnick2007-06-231-3/+8
| | | | | | | expected tests pass for all databases. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5519 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4040 -- Changed uses of has_key() to "in". Slight performanceMalcolm Tredinnick2007-04-261-2/+2
| | | | | | | | improvement and forward-compatible with future Python releases. Patch from Gary Wilson. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3741 -- Fixed serialization of GenericRelations. Thanks for the ↵Russell Keith-Magee2007-03-191-0/+1
| | | | | | report, Alexander Solovyov. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4752 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2301 -- Added list_display_links option to 'class Admin', which ↵Adrian Holovaty2006-07-101-1/+2
| | | | | | regulates which fields in the change list have links. Thanks, kilian git-svn-id: http://code.djangoproject.com/svn/django/trunk@3307 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixes #1812 -- Added model validity checks to ensure that models.py exists, ↵Russell Keith-Magee2006-06-251-1/+4
| | | | | | and has been successfully imported for all INSTALLED_APPS. Previous behaviour was to silently ignore empty/problem models, which resulted in the display of an admin page that doesn't display a supposedly installed model. Thanks to Ian Holsman for the original report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3201 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2109 -- Convert old-style classes to new-style classes throughout ↵Adrian Holovaty2006-06-081-2/+2
| | | | | | Django. Thanks, Nicola Larosa git-svn-id: http://code.djangoproject.com/svn/django/trunk@3113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #1884 -- Made django.db.models.options.get_verbose_name smarter. ↵Adrian Holovaty2006-05-151-1/+1
| | | | | | Thanks, Alex Dedul git-svn-id: http://code.djangoproject.com/svn/django/trunk@2909 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #1818 -- Added better error message for FieldDoesNotExist error. ↵Adrian Holovaty2006-05-091-1/+1
| | | | | | Thanks, Christopher Lenz git-svn-id: http://code.djangoproject.com/svn/django/trunk@2870 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly ↵Adrian Holovaty2006-05-021-0/+269
backwards-incompatible. Please read http://code.djangoproject.com/wiki/RemovingTheMagic for upgrade instructions. git-svn-id: http://code.djangoproject.com/svn/django/trunk@2809 bcc190cf-cafb-0310-a4f2-bffc1f526a37