Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #14268 -- Start the deprecation of the reset and sqlreset manag…

…ement command. Thanks, Carl.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14888 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a03a8adb3e46a2df78de604340e729766ae2c18a 1 parent 3d35ac7
Jannis Leidel authored December 12, 2010
6  django/core/management/commands/reset.py
@@ -20,6 +20,12 @@ class Command(AppCommand):
20 20
     output_transaction = True
21 21
 
22 22
     def handle_app(self, app, **options):
  23
+        # This command breaks a lot and should be deprecated
  24
+        import warnings
  25
+        warnings.warn(
  26
+            'This command has been deprecated. The command ``flush`` can be used to delete everything. You can also use ALTER TABLE or DROP TABLE statements manually.',
  27
+            PendingDeprecationWarning
  28
+        )
23 29
         using = options.get('database', DEFAULT_DB_ALIAS)
24 30
         connection = connections[using]
25 31
 
6  django/core/management/sql.py
@@ -98,6 +98,12 @@ def sql_delete(app, style, connection):
98 98
 
99 99
 def sql_reset(app, style, connection):
100 100
     "Returns a list of the DROP TABLE SQL, then the CREATE TABLE SQL, for the given module."
  101
+    # This command breaks a lot and should be deprecated
  102
+    import warnings
  103
+    warnings.warn(
  104
+        'This command has been deprecated. The command ``sqlflush`` can be used to delete everything. You can also use ALTER TABLE or DROP TABLE statements manually.',
  105
+        PendingDeprecationWarning
  106
+    )
101 107
     return sql_delete(app, style, connection) + sql_all(app, style, connection)
102 108
 
103 109
 def sql_flush(style, connection, only_django=False):
3  docs/internals/deprecation.txt
@@ -136,6 +136,9 @@ their deprecation, as per the :ref:`Django deprecation policy
136 136
           template variable, not an implied string. The new-style
137 137
           behavior is provided in the ``future`` template tag library.
138 138
 
  139
+        * The :djadmin:`reset` and :djadmin:`sqlreset` management commands
  140
+          are deprecated.
  141
+
139 142
     * 2.0
140 143
         * ``django.views.defaults.shortcut()``. This function has been moved
141 144
           to ``django.contrib.contenttypes.views.shortcut()`` as part of the
8  docs/ref/django-admin.txt
@@ -491,6 +491,10 @@ several lines in language files.
491 491
 reset <appname appname ...>
492 492
 ---------------------------
493 493
 
  494
+.. deprecated:: 1.3
  495
+    This command has been deprecated. The ``flush`` can be used to delete
  496
+    everything. You can also use ALTER TABLE or DROP TABLE statements manually.
  497
+
494 498
 .. django-admin:: reset
495 499
 
496 500
 Executes the equivalent of ``sqlreset`` for the given app name(s).
@@ -844,6 +848,10 @@ which to print the SQL.
844 848
 sqlreset <appname appname ...>
845 849
 ------------------------------
846 850
 
  851
+.. deprecated:: 1.3
  852
+    This command has been deprecated. The ``sqlflush`` can be used to delete
  853
+    everything. You can also use ALTER TABLE or DROP TABLE statements manually.
  854
+
847 855
 .. django-admin:: sqlreset
848 856
 
849 857
 Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s).
7  docs/releases/1.3.txt
@@ -468,3 +468,10 @@ in favor of a new :attr:`~django.contrib.admin.AdminSite.login_form`
468 468
 attribute.
469 469
 
470 470
 .. _r12634: http://code.djangoproject.com/changeset/12634
  471
+
  472
+``reset`` and ``sqlreset`` management commands
  473
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  474
+
  475
+Those commands have been deprecated. The ``flush`` and ``sqlflush`` commands
  476
+can be used to delete everything. You can also use ALTER TABLE or DROP TABLE
  477
+statements manually.

0 notes on commit a03a8ad

Please sign in to comment.
Something went wrong with that request. Please try again.