304 | | In [5898], we refactored `management.py`. This was partially to clean up a 1700 line file, but also to allow user applications to register commands for use in `management.py`. |
305 | | |
306 | | As a result, any calls to management services in your code will need to be adjusted. For example, if you have some test code that calls `flush` and `load_data`: |
| 304 | In [5898], we refactored {{{management.py}}}. This was partially to clean up a 1700-line file, but also to allow user applications to register commands for use in {{{management.py}}}. |
| 305 | |
| 306 | As a result, any calls to management services in your code will need to be adjusted. For example, if you have some test code that calls {{{flush}}} and {{{load_data}}}: |
| 319 | |
| 320 | == Refactored database backends == |
| 321 | |
| 322 | In a series of commits from [5949] to [5982], we refactored the database backends (the code in {{{django.db.backends}}}) to remove quite a bit of duplication, make it easier to maintain and extend, and to lay the groundwork for advanced features such as database connection pooling. |
| 323 | |
| 324 | As a result, almost *all* of the backend-level functions have been renamed and/or relocated. None of these were documented, but you'll need to change your code if you're using any of these functions: |
| 325 | |
| 326 | || '''Old name/location''' || '''New name/location''' || |
| 327 | || {{{django.db.backend.get_autoinc_sql}}} || {{{django.db.connection.ops.autoinc_sql}}} || |
| 328 | || {{{django.db.backend.get_date_extract_sql}}} || {{{django.db.connection.ops.date_extract_sql}}} || |
| 329 | || {{{django.db.backend.get_date_trunc_sql}}} || {{{django.db.connection.ops.date_trunc_sql}}} || |
| 330 | || {{{django.db.backend.get_datetime_cast_sql}}} || {{{django.db.connection.ops.datetime_cast_sql}}} || |
| 331 | || {{{django.db.backend.get_deferrable_sql}}} || {{{django.db.connection.ops.deferrable_sql}}} || |
| 332 | || {{{django.db.backend.get_drop_foreignkey_sql}}} || {{{django.db.connection.ops.drop_foreignkey_sql}}} || |
| 333 | || {{{django.db.backend.get_fulltext_search_sql}}} || {{{django.db.connection.ops.fulltext_search_sql}}} || |
| 334 | || {{{django.db.backend.get_last_insert_id}}} || {{{django.db.connection.ops.last_insert_id}}} || |
| 335 | || {{{django.db.backend.get_limit_offset_sql}}} || {{{django.db.connection.ops.limit_offset_sql}}} || |
| 336 | || {{{django.db.backend.get_max_name_length}}} || {{{django.db.connection.ops.max_name_length}}} || |
| 337 | || {{{django.db.backend.get_pk_default_value}}} || {{{django.db.connection.ops.pk_default_value}}} || |
| 338 | || {{{django.db.backend.get_random_function_sql}}} || {{{django.db.connection.ops.random_function_sql}}} || |
| 339 | || {{{django.db.backend.get_sql_flush}}} || {{{django.db.connection.ops.sql_flush}}} || |
| 340 | || {{{django.db.backend.get_sql_sequence_reset}}} || {{{django.db.connection.ops.sequence_reset_sql}}} || |
| 341 | || {{{django.db.backend.get_start_transaction_sql}}} || {{{django.db.connection.ops.start_transaction_sql}}} || |
| 342 | || {{{django.db.backend.get_tablespace_sql}}} || {{{django.db.connection.ops.tablespace_sql}}} || |
| 343 | || {{{django.db.backend.quote_name}}} || {{{django.db.connection.ops.quote_name}}} || |
| 344 | || {{{django.db.backend.get_query_set_class}}} || {{{django.db.connection.ops.query_set_class}}} || |
| 345 | || {{{django.db.backend.get_field_cast_sql}}} || {{{django.db.connection.ops.field_cast_sql}}} || |
| 346 | || {{{django.db.backend.get_drop_sequence}}} || {{{django.db.connection.ops.drop_sequence_sql}}} || |
| 347 | || {{{django.db.backend.OPERATOR_MAPPING}}} || {{{django.db.connection.operators}}} || |
| 348 | || {{{django.db.backend.allows_group_by_ordinal}}} || {{{django.db.connection.features.allows_group_by_ordinal}}} || |
| 349 | || {{{django.db.backend.allows_unique_and_pk}}} || {{{django.db.connection.features.allows_unique_and_pk}}} || |
| 350 | || {{{django.db.backend.autoindexes_primary_keys}}}|| {{{django.db.connection.features.autoindexes_primary_keys}}} || |
| 351 | || {{{django.db.backend.needs_datetime_string_cast}}}||{{{django.db.connection.features.needs_datetime_string_cast}}} || |
| 352 | || {{{django.db.backend.needs_upper_for_iops}}} || {{{django.db.connection.features.needs_upper_for_iops}}} || |
| 353 | || {{{django.db.backend.supports_constraints}}} || {{{django.db.connection.features.supports_constraints}}} || |
| 354 | || {{{django.db.backend.supports_tablespaces}}} || {{{django.db.connection.features.supports_tablespaces}}} || |
| 355 | || {{{django.db.backend.uses_case_insensitive_names}}} || {{{django.db.connection.features.uses_case_insensitive_names}}} || |
| 356 | || {{{django.db.backend.uses_custom_queryset}}} || {{{django.db.connection.features.uses_custom_queryset}}} || |