feat(market): basic page + submit
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import uuid
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
|
||||
|
||||
class BaseModel(models.Model):
|
||||
@@ -25,7 +24,9 @@ class Market(BaseModel):
|
||||
title = models.CharField(max_length=255)
|
||||
description = models.TextField(blank=True)
|
||||
type = models.CharField(max_length=10, choices=Type.choices, default=Type.YES_NO)
|
||||
status = models.CharField(max_length=10, choices=Status.choices, default=Status.OPEN)
|
||||
status = models.CharField(
|
||||
max_length=10, choices=Status.choices, default=Status.OPEN
|
||||
)
|
||||
end_date = models.DateTimeField()
|
||||
created_by = models.ForeignKey("accounts.CustomUser", on_delete=models.PROTECT)
|
||||
winning_option = models.ForeignKey(
|
||||
@@ -69,8 +70,12 @@ class MarketOption(BaseModel):
|
||||
|
||||
|
||||
class UserBet(BaseModel):
|
||||
user = models.ForeignKey("accounts.CustomUser", on_delete=models.CASCADE, related_name="bets")
|
||||
option = models.ForeignKey(MarketOption, on_delete=models.CASCADE, related_name="user_bets")
|
||||
user = models.ForeignKey(
|
||||
"accounts.CustomUser", on_delete=models.CASCADE, related_name="bets"
|
||||
)
|
||||
option = models.ForeignKey(
|
||||
MarketOption, on_delete=models.CASCADE, related_name="user_bets"
|
||||
)
|
||||
amount = models.PositiveIntegerField()
|
||||
|
||||
class Meta:
|
||||
|
||||
Reference in New Issue
Block a user