Changeset 9823 for src/django_gheat/gheat/management
- Timestamp:
- Dec 23, 2011, 9:16:20 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/django_gheat/gheat/management/commands/import_datafile.py
r9819 r9823 123 123 apparatuur, created = Apparatuur.objects.get_or_create(kaart=options['kaart']) 124 124 125 # Meetrondje is deducted and checked from first filename 126 filename = args[0] 127 logger.info("Processing '%s'" % filename) 128 meetrondje, created = MeetRondje.objects.get_or_create( 129 datum=get_date(filename), naam=get_meetrondje(filename), 130 gebruiker=gebruiker, apparatuur=apparatuur) 131 if not options['force'] and not created: 132 raise CommandError("Meetrondje '%s' already imported", meetrondje) 133 125 134 # Check if all files are valid 126 135 for filename in args: 127 logger.info("Processing '%s'" % filename)128 meetrondje, created = MeetRondje.objects.get_or_create(129 datum=get_date(filename), naam=get_meetrondje(filename),130 gebruiker=gebruiker, apparatuur=apparatuur)131 if not options['force'] and not created:132 logger.error("Meetrondje '%s' already imported", meetrondje)133 continue134 135 136 logger.info('Meetrondje: %s', meetrondje) 136 137 meetbestand = MeetBestand(meetrondje=meetrondje,is_imported=True)
Note:
See TracChangeset
for help on using the changeset viewer.