Base django project
This commit is contained in:
commit
0b58580a00
16 changed files with 278 additions and 0 deletions
17
nummi/main/models.py
Normal file
17
nummi/main/models.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import uuid
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Transaction(models.Model):
|
||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
name = models.CharField(max_length=256)
|
||||
description = models.TextField()
|
||||
value = models.DecimalField(max_digits=12, decimal_places=2)
|
||||
date = models.DateField()
|
||||
|
||||
|
||||
class Invoice(models.Model):
|
||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
name = models.CharField(max_length=256)
|
||||
file = models.FileField(upload_to="invoices/")
|
||||
transaction = models.ForeignKey(Transaction, on_delete=models.CASCADE)
|
Loading…
Add table
Add a link
Reference in a new issue