|
@@ -138,8 +138,9 @@ class LoanQuerySet(models.QuerySet):
|
|
|
|
|
|
class Loan(models.Model):
|
|
class Loan(models.Model):
|
|
item = models.ForeignKey(Item, verbose_name='objet', related_name='loans')
|
|
item = models.ForeignKey(Item, verbose_name='objet', related_name='loans')
|
|
- user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name='membre',
|
|
|
|
- related_name='loans')
|
|
|
|
|
|
+ user = models.ForeignKey(
|
|
|
|
+ settings.AUTH_USER_MODEL, verbose_name='membre',
|
|
|
|
+ related_name='loans', null=True, on_delete=models.SET_NULL)
|
|
loan_date = models.DateTimeField(verbose_name='date 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',
|
|
loan_date_end = models.DateTimeField(verbose_name='date de fin de prêt',
|
|
null=True, blank=True)
|
|
null=True, blank=True)
|