File tree Expand file tree Collapse file tree 4 files changed +18
-9
lines changed
stdimage/management/commands Expand file tree Collapse file tree 4 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -32,3 +32,5 @@ multi_line_output = 5
3232line_length = 79
3333combine_as_imports = true
3434skip = wsgi.py,docs,tests/test_models.py
35+ known_first_party = stdimage,tests
36+ known_third_party = django
Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ class Command(BaseCommand):
2828 args = '<app.model.field app.model.field>'
2929
3030 def add_arguments (self , parser ):
31+ parser .add_argument ('field_path' ,
32+ nargs = '+' ,
33+ type = str ,
34+ help = '<app.model.field app.model.field>' )
3135 parser .add_argument ('--replace' ,
3236 action = 'store_true' ,
3337 dest = 'replace' ,
@@ -36,7 +40,8 @@ def add_arguments(self, parser):
3640
3741 def handle (self , * args , ** options ):
3842 replace = options .get ('replace' )
39- for route in args :
43+ pathes = options ['field_path' ] if len (options ['field_path' ]) else [options ['field_path' ]]
44+ for route in pathes :
4045 app_label , model_name , field_name = route .rsplit ('.' )
4146 model_class = apps .get_model (app_label , model_name )
4247 field = model_class ._meta .get_field (field_name )
Original file line number Diff line number Diff line change 2525
2626DEFAULT_FILE_STORAGE = 'tests.storage.MyFileSystemStorage'
2727
28+ TEMPLATES = [
29+ {
30+ 'BACKEND' : 'django.template.backends.django.DjangoTemplates' ,
31+ 'APP_DIRS' : True ,
32+ }
33+ ]
34+
2835MIDDLEWARE_CLASSES = (
2936 'django.contrib.sessions.middleware.SessionMiddleware' ,
3037 'django.contrib.auth.middleware.AuthenticationMiddleware' ,
Original file line number Diff line number Diff line change 1- try :
2- from django .conf .urls .defaults import patterns , url , include
3- except ImportError :
4- from django .conf .urls import patterns , url , include
5-
1+ from django .conf .urls import include , url
62from django .contrib import admin
73
84admin .autodiscover ()
95
10- urlpatterns = patterns (
11- '' ,
6+ urlpatterns = [
127 url (r'^admin/' , include (admin .site .urls )),
13- )
8+ ]
You can’t perform that action at this time.
0 commit comments