Django

Code

Changeset 607

Show
Ignore:
Timestamp:
09/02/05 13:26:16 (3 years ago)
Author:
adrian
Message:

Fixed #454 -- Clarified django-admin '--help' output to use 'modelmodule' instead of 'app'. Thanks, Maniac

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/management.py

    r550 r607  
    1313    {%% endif %%}''' 
    1414 
    15 APP_ARGS = '[app app ...]' 
     15APP_ARGS = '[modelmodule ...]' 
    1616 
    1717# Use django.__path__[0] because we don't know which directory django into 
     
    102102            final_output.append('\n'.join(table_output)) 
    103103    return final_output 
    104 get_sql_create.help_doc = "Prints the CREATE TABLE SQL statements for the given app(s)." 
     104get_sql_create.help_doc = "Prints the CREATE TABLE SQL statements for the given model module name(s)." 
    105105get_sql_create.args = APP_ARGS 
    106106 
     
    148148 
    149149    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)." 
     150get_sql_delete.help_doc = "Prints the DROP TABLE SQL statements for the given model module name(s)." 
    151151get_sql_delete.args = APP_ARGS 
    152152 
     
    154154    "Returns a list of the DROP TABLE SQL, then the CREATE TABLE SQL, for the given module." 
    155155    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)." 
     156get_sql_reset.help_doc = "Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given model module name(s)." 
    157157get_sql_reset.args = APP_ARGS 
    158158 
     
    177177            output.append(_get_permission_insert(name, codename, opts)) 
    178178    return output 
    179 get_sql_initial_data.help_doc = "Prints the initial INSERT SQL statements for the given app(s)." 
     179get_sql_initial_data.help_doc = "Prints the initial INSERT SQL statements for the given model module name(s)." 
    180180get_sql_initial_data.args = APP_ARGS 
    181181 
     
    189189                output.append("SELECT setval('%s_%s_seq', (SELECT max(%s) FROM %s));" % (klass._meta.db_table, f.column, f.column, klass._meta.db_table)) 
    190190    return output 
    191 get_sql_sequence_reset.help_doc = "Prints the SQL statements for resetting PostgreSQL sequences for the given app(s)." 
     191get_sql_sequence_reset.help_doc = "Prints the SQL statements for resetting PostgreSQL sequences for the given model module name(s)." 
    192192get_sql_sequence_reset.args = APP_ARGS 
    193193 
     
    202202                    (unique, klass._meta.db_table, f.column, klass._meta.db_table, f.column)) 
    203203    return output 
    204 get_sql_indexes.help_doc = "Prints the CREATE INDEX SQL statements for the given app(s)." 
     204get_sql_indexes.help_doc = "Prints the CREATE INDEX SQL statements for the given model module name(s)." 
    205205get_sql_indexes.args = APP_ARGS 
    206206 
     
    208208    "Returns a list of CREATE TABLE SQL and initial-data insert for the given module." 
    209209    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)." 
     210get_sql_all.help_doc = "Prints the CREATE TABLE and initial-data SQL statements for the given model module name(s)." 
    211211get_sql_all.args = APP_ARGS 
    212212 
     
    260260#             sys.stderr.write("A content type called '%s.%s' was found in the database but not in the model.\n" % (app_label, row[0])) 
    261261            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." 
     262database_check.help_doc = "Checks that everything is installed in the database for the given model module name(s) and prints SQL statements if needed." 
    263263database_check.args = APP_ARGS 
    264264 
     
    282282    output.append('{% endif %}') 
    283283    return output 
    284 get_admin_index.help_doc = "Prints the admin-index template snippet for the given app(s)." 
     284get_admin_index.help_doc = "Prints the admin-index template snippet for the given model module name(s)." 
    285285get_admin_index.args = APP_ARGS 
    286286 
     
    322322        sys.exit(1) 
    323323    db.db.commit() 
    324 install.help_doc = "Executes ``sqlall`` for the given app(s) in the current database." 
     324install.help_doc = "Executes ``sqlall`` for the given model module name(s) in the current database." 
    325325install.args = APP_ARGS 
    326326 
     
    377377 
    378378def 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." 
    380380    # Determine the project_name a bit naively -- by looking at the name of 
    381381    # the parent directory. 
  • django/trunk/docs/django-admin.txt

    r539 r607  
    2323list of all available actions and options. 
    2424 
    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"``. 
     25Most actions take a list of "modelmodule"s. A "modelmodule," in this case, is 
     26the name of a file containing Django models. For example, if you have a model 
     27module called ``myproject/apps/polls/pollmodels.py``, the "modelmodule" in this 
     28case would be ``"pollmodels"``. 
    2929 
    3030Available actions 
    3131================= 
    3232 
    33 adminindex [app app ...] 
     33adminindex [modelmodule modelmodule ...] 
    3434------------------------ 
    3535 
    36 Prints the admin-index template snippet for the given app(s). 
     36Prints the admin-index template snippet for the given model module(s). 
    3737 
    3838Use admin-index template snippets if you want to customize the look and feel of 
     
    7676works in PostgreSQL. 
    7777 
    78 install [app app ...] 
     78install [modelmodule modelmodule ...] 
    7979--------------------- 
    8080 
    81 Executes the equivalent of ``sqlall`` for the given app(s). 
     81Executes the equivalent of ``sqlall`` for the given model module(s). 
    8282 
    8383runserver [optional port number, or ipaddr:port] 
     
    116116    django-admin.py runserver 1.2.3.4:7000 
    117117 
    118 sql [app app ...] 
     118sql [modelmodule modelmodule ...] 
    119119----------------- 
    120120 
    121 Prints the CREATE TABLE SQL statements for the given app(s). 
     121Prints the CREATE TABLE SQL statements for the given model module(s). 
    122122 
    123 sqlall [app app ...] 
     123sqlall [modelmodule modelmodule ...] 
    124124-------------------- 
    125125 
    126 Prints the CREATE TABLE and initial-data SQL statements for the given app(s). 
     126Prints the CREATE TABLE and initial-data SQL statements for the given model module(s). 
    127127 
    128 sqlclear [app app ...] 
     128sqlclear [modelmodule modelmodule ...] 
    129129---------------------- 
    130130 
    131 Prints the DROP TABLE SQL statements for the given app(s). 
     131Prints the DROP TABLE SQL statements for the given model module(s). 
    132132 
    133 sqlindexes [app app ...] 
     133sqlindexes [modelmodule modelmodule ...] 
    134134------------------------ 
    135135 
    136 Prints the CREATE INDEX SQL statements for the given app(s). 
     136Prints the CREATE INDEX SQL statements for the given model module(s). 
    137137 
    138 sqlinitialdata [app app ...] 
     138sqlinitialdata [modelmodule modelmodule ...] 
    139139---------------------------- 
    140140 
    141 Prints the initial INSERT SQL statements for the given app(s). 
     141Prints the initial INSERT SQL statements for the given model module(s). 
    142142 
    143 sqlreset [app app ...] 
     143sqlreset [modelmodule modelmodule ...] 
    144144---------------------- 
    145145 
    146 Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app(s). 
     146Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given model module(s). 
    147147 
    148 sqlsequencereset [app app ...] 
     148sqlsequencereset [modelmodule modelmodule ...] 
    149149------------------------------ 
    150150 
    151151Prints the SQL statements for resetting PostgreSQL sequences for the given 
    152 app(s). 
     152model module(s). 
    153153 
    154154See http://simon.incutio.com/archive/2004/04/21/postgres for more information.