Initial commit
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
from django.db import models
|
||||
from .district import District
|
||||
from .device import Device
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
class Rent(models.Model):
|
||||
address = models.CharField(max_length=100, unique=True)
|
||||
@@ -9,6 +11,15 @@ class Rent(models.Model):
|
||||
due_date = models.DateField()
|
||||
amount = models.IntegerField()
|
||||
|
||||
is_paid = models.BooleanField(default=False)
|
||||
paid_at = models.DateTimeField(null=True, blank=True)
|
||||
created_by = models.ForeignKey(
|
||||
settings.AUTH_USER_MODEL,
|
||||
related_name="created_rents",
|
||||
on_delete=models.PROTECT,
|
||||
null=True,
|
||||
blank=True
|
||||
)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
def __str__(self):
|
||||
|
||||
Reference in New Issue
Block a user