Add creation time to Transaction model
This commit is contained in:
parent
f514af6f5f
commit
fa993289b1
|
@ -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
|
||||
}
|
||||
```
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user