Add creation time to Transaction model

This commit is contained in:
Tanner Collin 2021-04-15 00:07:12 +00:00
parent f514af6f5f
commit fa993289b1
2 changed files with 3 additions and 0 deletions

View File

@ -60,5 +60,6 @@ type Transaction = {
stack_id: string
amount: integer // cents
details: string
created_at: UTC datetime ie: 2021-04-15T00:06:21.852620Z
}
```

View File

@ -1,5 +1,6 @@
from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
import uuid
@ -28,3 +29,4 @@ class Transaction(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
details = models.TextField()
amount = models.DecimalField(max_digits=12, decimal_places=2)
created_at = models.DateTimeField(default=timezone.now)