]> git.parisson.com Git - telemeta.git/commitdiff
add width variable
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 8 Dec 2014 17:00:55 +0000 (18:00 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 8 Dec 2014 17:00:55 +0000 (18:00 +0100)
telemeta/management/commands/telemeta-export-fields.py

index da24f69edb3ccb60ed978d5cf022834354276a61..40e5984af24b0610242e3bda236050285007bb0c 100644 (file)
@@ -17,6 +17,7 @@ class Command(BaseCommand):
     admin_email = 'webmaster@parisson.com'
     language_codes = ['en_US', 'fr_FR', 'de_DE']
     models = [MediaFonds, MediaCorpus, MediaCollection, MediaItem]
+    width = 256
 
     def handle(self, *args, **options):
         self.file = args[0]
@@ -24,12 +25,12 @@ class Command(BaseCommand):
         for model in self.models:
             self.sheet = self.book.add_sheet(model.element_type)
             self.sheet.write(0, 0, 'Field')
-            self.sheet.col(0).width = 256*32
+            self.sheet.col(0).width = self.width*32
 
             k = 1
             for language_code in self.language_codes:
                 self.sheet.write(0, k, language_code)
-                self.sheet.col(k).width = 256*32
+                self.sheet.col(k).width = self.width*32
                 k += 1
 
             i = 1