Esempio n. 1
0
 def handle(self, *args, **options):
     if len(args) != 1:
         raise CommandError("this command takes in only one filename!")
     counter = 0
     with open(args[0], "r") as file_:
         reader = csv.DictReader(file_, [
                                         "latitude", 
                                         "longitude",
                                         "name",
                                         "city"
                                         ],
                                 )
         
         for entry in reader:
             created = self.make_or_update_location(entry)
             if created:
                 counter += 1
     update_all_alko_infos()
     self.stdout.write('updated values with %d new insertions' %counter)
Esempio n. 2
0
 def handle(self, *args, **options):
     update_all_alko_infos()
     self.stdout.write('Scheduled alko info update')