mirror of
https://github.com/lemeow125/Borrowing-TrackerBackend.git
synced 2024-11-17 06:19:26 +08:00
16 lines
656 B
Python
16 lines
656 B
Python
from django.db import models
|
|
from accounts.models import CustomUser
|
|
from transactions.models import Transaction
|
|
from equipments.models import EquipmentInstance
|
|
from django.utils.timezone import now
|
|
|
|
|
|
class BreakageReport(models.Model):
|
|
transaction = models.ForeignKey(
|
|
Transaction, on_delete=models.CASCADE)
|
|
equipments = models.ManyToManyField(EquipmentInstance)
|
|
resolved = models.BooleanField(default=False)
|
|
timestamp = models.DateTimeField(default=now, editable=False)
|
|
|
|
def __str__(self):
|
|
return f"Breakage report for transaction #{self.transaction.id} by {self.transaction.borrower} under {self.transaction.teacher}"
|