Ticket #2557: django-admin-syncmedia.diff
File django-admin-syncmedia.diff, 1.4 KB (added by , 18 years ago) |
---|
-
django/core/management.py
423 423 get_sql_all.help_doc = "Prints the CREATE TABLE, initial-data and CREATE INDEX SQL statements for the given model module name(s)." 424 424 get_sql_all.args = APP_ARGS 425 425 426 def syncmedia(): 427 "Sync all media files from INSTALLED_APPS into MEDIA_ROOT" 428 from django.conf import settings 429 from django.contrib.media import sync_media_root 430 431 if settings.MEDIA_ROOT: 432 sync_media_root() 433 434 syncmedia.args = '' 435 426 436 def syncdb(): 427 437 "Creates the database tables for all apps in INSTALLED_APPS whose tables haven't already been created." 428 438 from django.db import connection, transaction, models, get_creation_module … … 1177 1187 'startapp': startapp, 1178 1188 'startproject': startproject, 1179 1189 'syncdb': syncdb, 1190 'syncmedia': syncmedia, 1180 1191 'validate': validate, 1181 1192 } 1182 1193 … … 1189 1200 'reset', 1190 1201 'sqlindexes', 1191 1202 'syncdb', 1203 'syncmedia', 1192 1204 ) 1193 1205 1194 1206 class DjangoOptionParser(OptionParser): … … 1256 1268 1257 1269 if action == 'shell': 1258 1270 action_mapping[action](options.plain is True) 1259 elif action in ('syncdb', ' validate', 'diffsettings', 'dbshell'):1271 elif action in ('syncdb', 'syncmedia', 'validate', 'diffsettings', 'dbshell'): 1260 1272 action_mapping[action]() 1261 1273 elif action == 'inspectdb': 1262 1274 try: