matthewwithanm / django-imagekit

Automated image processing for Django. Currently v4.0
http://django-imagekit.rtfd.org/
BSD 3-Clause "New" or "Revised" License
2.26k stars 276 forks source link

generatesimages needs update #430

Closed x-yuri closed 7 years ago

x-yuri commented 7 years ago
--- old
+++ new
@@ -12,13 +12,15 @@
 "a:*:c" will match "a:b:c", but not "a:b:x:c", whereas "a:**:c" will
 match both. Subsegments are always matched, so "a" will match "a" as                          
 well as "a:b" and "a:b:c".""")                
-    args = '[generator_ids]'                                                                  
+                                                                                              
+    def add_arguments(self, parser):
+        parser.add_argument('generator_id', nargs='*', help='<app_name>:<model>:<field> for model specs')

     def handle(self, *args, **options):
         generators = generator_registry.get_ids()

-        if args:
-            patterns = self.compile_patterns(args)
+        if options['generator_id']:
+            patterns = self.compile_patterns(options['generator_id'])
             generators = (id for id in generators if any(p.match(id) for p in patterns))

         for generator_id in generators:

Should I create a PR?

vstoykov commented 7 years ago

I'll be glad if you prepare a pull request. Tank you.