Last active
November 14, 2015 12:29
-
-
Save arecker/46d5c4042c12642ec066 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