diff --git a/RIGS/importer.py b/RIGS/importer.py index 9d6f86da..6c72c807 100644 --- a/RIGS/importer.py +++ b/RIGS/importer.py @@ -12,7 +12,7 @@ from django.db.utils import ConnectionDoesNotExist from django.db import transaction from RIGS import models import reversion - +from datetime import datetime def setup_cursor(): try: @@ -79,7 +79,8 @@ def import_vat_rates(): sql = """SELECT `id`, `start_date`, `start_time`, `comment`, `rate` FROM `vat_rates`""" cursor.execute(sql) for row in cursor.fetchall(): - object, created = models.VatRate.objects.get_or_create(pk=row[0], start_at=row[1] + " " + row[2], + start_at = datetime.combine(row[1], row[2]) + object, created = models.VatRate.objects.get_or_create(pk=row[0], start_at=start_at, comment=row[3], rate=row[4]) if created: print("Created: " + object.__unicode__()) @@ -96,4 +97,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/RIGS/models.py b/RIGS/models.py index d86c8e07..dca98de2 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -69,4 +69,4 @@ class VatRate(models.Model, RevisionMixin): comment = models.CharField(max_length=255) def __unicode__(self): - return self.comment + " " + self.start_at + " @ " + self.rate \ No newline at end of file + return self.comment + " " + str(self.start_at) + " @ " + str(self.rate) diff --git a/db.sqlite3 b/db.sqlite3 index b454e20b..55d16369 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ