在Django模型中有两个datefield,即start_date和end_date。我想计算和存储两者之间的总天数,这将与每日费用一起使用,以返回总成本。
models.py
class Booking(models.Model):
"""Stores the bookings, for example when it was made, the booking date, and the car ID."""
# Unique ID for this booking.
start_date = models.Date