forked from mike/django
75 lines
2.7 KiB
Python
75 lines
2.7 KiB
Python
from django.db import models
|
|
from users.models import User
|
|
from django.contrib import admin
|
|
|
|
|
|
# Create your models here.
|
|
|
|
class CryptoCoins(models.Model):
|
|
id = models.BigAutoField(primary_key=True)
|
|
coinName = models.CharField(max_length=250)
|
|
coinSymbol = models.CharField(max_length=10)
|
|
coinIsActive = models.BooleanField(default=True)
|
|
coinAddDate = models.DateTimeField(auto_now_add=True)
|
|
coinUpdated = models.DateTimeField(auto_now=True)
|
|
coinDelete = models.DateTimeField(auto_now_add=True, blank=True, null=True)
|
|
coinDeleted = models.BooleanField(default=False)
|
|
|
|
class Meta:
|
|
verbose_name = "Crypto Coin"
|
|
verbose_name_plural = "Crypto Coins"
|
|
ordering = ["-id"]
|
|
|
|
class VendorsData(models.Model):
|
|
id = models.BigAutoField(primary_key=True)
|
|
vendorid = models.ForeignKey(User, default=None, on_delete=models.CASCADE)
|
|
vendorUUID = models.UUIDField()
|
|
vendor = models.CharField(max_length=8, unique=True)
|
|
vendorSecretKey = models.CharField(max_length=250)
|
|
vendorCoverAmount = models.IntegerField(default=0)
|
|
vendorNetworkFee = models.IntegerField(default=0)
|
|
vendorPaidNotification = models.BooleanField(default=True)
|
|
vendorSkipScreen = models.BooleanField(default=False)
|
|
vendorPayWindow = models.BooleanField(default=True)
|
|
vendorWebName = models.CharField(max_length=250)
|
|
vendorWebAddr = models.URLField(max_length=250)
|
|
vendorAddDate = models.DateTimeField(auto_now_add=True)
|
|
vendorDeleted = models.BooleanField(default=False)
|
|
vendorUpdated = models.DateTimeField(auto_now=True)
|
|
vendorAddDelete = models.DateTimeField(auto_now_add=True)
|
|
vendorIsActive = models.BooleanField(default=True)
|
|
|
|
def __str__(self):
|
|
return self.vendor
|
|
|
|
def __repr__(self):
|
|
return self._repr()
|
|
|
|
class Meta:
|
|
verbose_name = "Vendor"
|
|
verbose_name_plural = "Vendors"
|
|
ordering = ["-id"]
|
|
|
|
class VendorsAddresses(models.Model):
|
|
id = models.BigAutoField(primary_key=True)
|
|
vendor = models.ForeignKey(VendorsData, default=None, on_delete=models.CASCADE)
|
|
vendorid = models.ForeignKey(User, default=None, on_delete=models.CASCADE)
|
|
vendorUUID = models.UUIDField()
|
|
coin = models.CharField(max_length=10)
|
|
address = models.CharField(max_length=250)
|
|
addrAddDate = models.DateTimeField(auto_now_add=True)
|
|
addrDeleted = models.BooleanField(default=False)
|
|
addrUpdated = models.DateTimeField(auto_now=True)
|
|
addrIsActive = models.BooleanField(default=True)
|
|
|
|
def __str__(self):
|
|
return self.address
|
|
|
|
class Meta:
|
|
verbose_name = "Address"
|
|
verbose_name_plural = "Addresses"
|
|
ordering = ["-addrAddDate"]
|
|
|
|
|
|
|