-
-
Save danechitoaie/d796be36c8c54b20f80a to your computer and use it in GitHub Desktop.
models
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from uuid import uuid4 | |
from django.db import models | |
from django.core.validators import MinValueValidator | |
class Rate(models.Model): | |
id = models.UUIDField(primary_key=True, | |
editable=False, | |
default=uuid4, | |
unique=True) | |
description = models.CharField(max_length=120) | |
amount = models.DecimalField(max_digits=8, decimal_places=2) | |
days = models.PositiveIntegerField(validators=[MinValueValidator(1)]) | |
amount_per_day = models.DecimalField(max_digits=8, | |
decimal_places=3, | |
editable=False, | |
blank=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment