Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #454 -- Clarified django-admin '--help' output to use 'modelmod…

…ule' instead of 'app'. Thanks, Maniac

git-svn-id: http://code.djangoproject.com/svn/django/trunk@607 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 59b204526ee03e936876365f1c8b5d856c5b8770 1 parent fe66d3b
Adrian Holovaty authored September 02, 2005
24  django/core/management.py
@@ -12,7 +12,7 @@
12 12
     </tr>
13 13
     {%% endif %%}'''
14 14
 
15  
-APP_ARGS = '[app app ...]'
  15
+APP_ARGS = '[modelmodule ...]'
16 16
 
17 17
 # Use django.__path__[0] because we don't know which directory django into
18 18
 # which has been installed.
@@ -101,7 +101,7 @@ def get_sql_create(mod):
101 101
             table_output.append(');')
102 102
             final_output.append('\n'.join(table_output))
103 103
     return final_output
104  
-get_sql_create.help_doc = "Prints the CREATE TABLE SQL statements for the given app(s)."
  104
+get_sql_create.help_doc = "Prints the CREATE TABLE SQL statements for the given model module name(s)."
105 105
 get_sql_create.args = APP_ARGS
106 106
 
107 107
 def get_sql_delete(mod):
@@ -147,13 +147,13 @@ def get_sql_delete(mod):
147 147
             output.append("DELETE FROM auth_admin_log WHERE content_type_id = %s;" % row[0])
148 148
 
149 149
     return output[::-1] # Reverse it, to deal with table dependencies.
150  
-get_sql_delete.help_doc = "Prints the DROP TABLE SQL statements for the given app(s)."
  150
+get_sql_delete.help_doc = "Prints the DROP TABLE SQL statements for the given model module name(s)."
151 151
 get_sql_delete.args = APP_ARGS
152 152
 
153 153
 def get_sql_reset(mod):
154 154
     "Returns a list of the DROP TABLE SQL, then the CREATE TABLE SQL, for the given module."
155 155
     return get_sql_delete(mod) + get_sql_all(mod)
156  
-get_sql_reset.help_doc = "Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app(s)."
  156
+get_sql_reset.help_doc = "Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given model module name(s)."
157 157
 get_sql_reset.args = APP_ARGS
158 158
 
159 159
 def get_sql_initial_data(mod):
@@ -176,7 +176,7 @@ def get_sql_initial_data(mod):
176 176
         for codename, name in _get_all_permissions(opts):
177 177
             output.append(_get_permission_insert(name, codename, opts))
178 178
     return output
179  
-get_sql_initial_data.help_doc = "Prints the initial INSERT SQL statements for the given app(s)."
  179
+get_sql_initial_data.help_doc = "Prints the initial INSERT SQL statements for the given model module name(s)."
180 180
 get_sql_initial_data.args = APP_ARGS
181 181
 
182 182
 def get_sql_sequence_reset(mod):
@@ -188,7 +188,7 @@ def get_sql_sequence_reset(mod):
188 188
             if isinstance(f, meta.AutoField):
189 189
                 output.append("SELECT setval('%s_%s_seq', (SELECT max(%s) FROM %s));" % (klass._meta.db_table, f.column, f.column, klass._meta.db_table))
190 190
     return output
191  
-get_sql_sequence_reset.help_doc = "Prints the SQL statements for resetting PostgreSQL sequences for the given app(s)."
  191
+get_sql_sequence_reset.help_doc = "Prints the SQL statements for resetting PostgreSQL sequences for the given model module name(s)."
192 192
 get_sql_sequence_reset.args = APP_ARGS
193 193
 
194 194
 def get_sql_indexes(mod):
@@ -201,13 +201,13 @@ def get_sql_indexes(mod):
201 201
                 output.append("CREATE %sINDEX %s_%s ON %s (%s);" % \
202 202
                     (unique, klass._meta.db_table, f.column, klass._meta.db_table, f.column))
203 203
     return output
204  
-get_sql_indexes.help_doc = "Prints the CREATE INDEX SQL statements for the given app(s)."
  204
+get_sql_indexes.help_doc = "Prints the CREATE INDEX SQL statements for the given model module name(s)."
205 205
 get_sql_indexes.args = APP_ARGS
206 206
 
207 207
 def get_sql_all(mod):
208 208
     "Returns a list of CREATE TABLE SQL and initial-data insert for the given module."
209 209
     return get_sql_create(mod) + get_sql_initial_data(mod)
210  
-get_sql_all.help_doc = "Prints the CREATE TABLE and initial-data SQL statements for the given app(s)."
  210
+get_sql_all.help_doc = "Prints the CREATE TABLE and initial-data SQL statements for the given model module name(s)."
211 211
 get_sql_all.args = APP_ARGS
212 212
 
213 213
 def database_check(mod):
@@ -259,7 +259,7 @@ def database_check(mod):
259 259
         except KeyError:
260 260
 #             sys.stderr.write("A content type called '%s.%s' was found in the database but not in the model.\n" % (app_label, row[0]))
261 261
             print "DELETE FROM content_types WHERE package='%s' AND python_module_name = '%s';" % (app_label, row[0])
262  
-database_check.help_doc = "Checks that everything is installed in the database for the given app(s) and prints SQL statements if needed."
  262
+database_check.help_doc = "Checks that everything is installed in the database for the given model module name(s) and prints SQL statements if needed."
263 263
 database_check.args = APP_ARGS
264 264
 
265 265
 def get_admin_index(mod):
@@ -281,7 +281,7 @@ def get_admin_index(mod):
281 281
     output.append('</table></div>')
282 282
     output.append('{% endif %}')
283 283
     return output
284  
-get_admin_index.help_doc = "Prints the admin-index template snippet for the given app(s)."
  284
+get_admin_index.help_doc = "Prints the admin-index template snippet for the given model module name(s)."
285 285
 get_admin_index.args = APP_ARGS
286 286
 
287 287
 def init():
@@ -321,7 +321,7 @@ def install(mod):
321 321
         db.db.rollback()
322 322
         sys.exit(1)
323 323
     db.db.commit()
324  
-install.help_doc = "Executes ``sqlall`` for the given app(s) in the current database."
  324
+install.help_doc = "Executes ``sqlall`` for the given model module name(s) in the current database."
325 325
 install.args = APP_ARGS
326 326
 
327 327
 def _start_helper(app_or_project, name, directory, other_name=''):
@@ -376,7 +376,7 @@ def startproject(project_name, directory):
376 376
 startproject.args = "[projectname]"
377 377
 
378 378
 def startapp(app_name, directory):
379  
-    "Creates a Django app for the given project_name in the given directory."
  379
+    "Creates a Django app for the given app_name in the given directory."
380 380
     # Determine the project_name a bit naively -- by looking at the name of
381 381
     # the parent directory.
382 382
     project_dir = os.path.normpath(os.path.join(directory, '../'))
44  docs/django-admin.txt
@@ -22,18 +22,18 @@ document.
22 22
 Run ``django-admin.py --help`` to display a help message that includes a terse
23 23
 list of all available actions and options.
24 24
 
25  
-Most actions take a list of "app"s. An "app," in this case, is the name of
26  
-a file containing Django models. For example, if you have a model module called
27  
-``myproject/apps/polls/pollmodels.py``, the "app" in this case would be
28  
-``"pollmodels"``.
  25
+Most actions take a list of "modelmodule"s. A "modelmodule," in this case, is
  26
+the name of a file containing Django models. For example, if you have a model
  27
+module called ``myproject/apps/polls/pollmodels.py``, the "modelmodule" in this
  28
+case would be ``"pollmodels"``.
29 29
 
30 30
 Available actions
31 31
 =================
32 32
 
33  
-adminindex [app app ...]
  33
+adminindex [modelmodule modelmodule ...]
34 34
 ------------------------
35 35
 
36  
-Prints the admin-index template snippet for the given app(s).
  36
+Prints the admin-index template snippet for the given model module(s).
37 37
 
38 38
 Use admin-index template snippets if you want to customize the look and feel of
39 39
 your admin's index page. See `Tutorial 2`_ for more information.
@@ -75,10 +75,10 @@ customizations. In particular, you'll need to do this:
75 75
 ``inspectdb`` only works with PostgreSQL and MySQL. Foreign-key detection only
76 76
 works in PostgreSQL.
77 77
 
78  
-install [app app ...]
  78
+install [modelmodule modelmodule ...]
79 79
 ---------------------
80 80
 
81  
-Executes the equivalent of ``sqlall`` for the given app(s).
  81
+Executes the equivalent of ``sqlall`` for the given model module(s).
82 82
 
83 83
 runserver [optional port number, or ipaddr:port]
84 84
 ------------------------------------------------
@@ -115,41 +115,41 @@ Port 7000 on IP address 1.2.3.4::
115 115
 
116 116
     django-admin.py runserver 1.2.3.4:7000
117 117
 
118  
-sql [app app ...]
  118
+sql [modelmodule modelmodule ...]
119 119
 -----------------
120 120
 
121  
-Prints the CREATE TABLE SQL statements for the given app(s).
  121
+Prints the CREATE TABLE SQL statements for the given model module(s).
122 122
 
123  
-sqlall [app app ...]
  123
+sqlall [modelmodule modelmodule ...]
124 124
 --------------------
125 125
 
126  
-Prints the CREATE TABLE and initial-data SQL statements for the given app(s).
  126
+Prints the CREATE TABLE and initial-data SQL statements for the given model module(s).
127 127
 
128  
-sqlclear [app app ...]
  128
+sqlclear [modelmodule modelmodule ...]
129 129
 ----------------------
130 130
 
131  
-Prints the DROP TABLE SQL statements for the given app(s).
  131
+Prints the DROP TABLE SQL statements for the given model module(s).
132 132
 
133  
-sqlindexes [app app ...]
  133
+sqlindexes [modelmodule modelmodule ...]
134 134
 ------------------------
135 135
 
136  
-Prints the CREATE INDEX SQL statements for the given app(s).
  136
+Prints the CREATE INDEX SQL statements for the given model module(s).
137 137
 
138  
-sqlinitialdata [app app ...]
  138
+sqlinitialdata [modelmodule modelmodule ...]
139 139
 ----------------------------
140 140
 
141  
-Prints the initial INSERT SQL statements for the given app(s).
  141
+Prints the initial INSERT SQL statements for the given model module(s).
142 142
 
143  
-sqlreset [app app ...]
  143
+sqlreset [modelmodule modelmodule ...]
144 144
 ----------------------
145 145
 
146  
-Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app(s).
  146
+Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given model module(s).
147 147
 
148  
-sqlsequencereset [app app ...]
  148
+sqlsequencereset [modelmodule modelmodule ...]
149 149
 ------------------------------
150 150
 
151 151
 Prints the SQL statements for resetting PostgreSQL sequences for the given
152  
-app(s).
  152
+model module(s).
153 153
 
154 154
 See http://simon.incutio.com/archive/2004/04/21/postgres for more information.
155 155
 

0 notes on commit 59b2045

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