Skip to content

Instantly share code, notes, and snippets.

@danechitoaie
Forked from arecker/models.py
Created November 14, 2015 12:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danechitoaie/d796be36c8c54b20f80a to your computer and use it in GitHub Desktop.
Save danechitoaie/d796be36c8c54b20f80a to your computer and use it in GitHub Desktop.
models
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