Browse Source

Switch loan dates from dates to datetimes

More accurate to tell if a loan is finished.
Jocelyn Delalande 8 years ago
parent
commit
64e31fd6a7

+ 26 - 0
hardware_provisioning/migrations/0011_auto_20161028_2009.py

@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('hardware_provisioning', '0010_auto_20160405_2237'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='loan',
+            name='loan_date',
+            field=models.DateTimeField(verbose_name='date de pr\xeat'),
+            preserve_default=True,
+        ),
+        migrations.AlterField(
+            model_name='loan',
+            name='loan_date_end',
+            field=models.DateTimeField(null=True, verbose_name='date de fin de pr\xeat', blank=True),
+            preserve_default=True,
+        ),
+    ]

+ 2 - 2
hardware_provisioning/models.py

@@ -111,8 +111,8 @@ class Loan(models.Model):
     item = models.ForeignKey(Item, verbose_name='objet', related_name='loans')
     user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name='membre',
                              related_name='loans')
-    loan_date = models.DateField(verbose_name='date de prêt')
-    loan_date_end = models.DateField(verbose_name='date de fin de prêt',
+    loan_date = models.DateTimeField(verbose_name='date de prêt')
+    loan_date_end = models.DateTimeField(verbose_name='date de fin de prêt',
                                      null=True, blank=True)
     notes = models.TextField(null=True, blank=True)