25 lines
629 B
Python
25 lines
629 B
Python
from django.db import models
|
|
import jsonfield
|
|
from qrtr_account.models import Account
|
|
|
|
|
|
class ConnectionType(models.Model):
|
|
name = models.CharField(max_length=255)
|
|
filename = models.CharField(max_length=255, unique=True)
|
|
|
|
def __str__(self):
|
|
return f"{self.name}"
|
|
|
|
|
|
class Connection(models.Model):
|
|
name = models.CharField(max_length=255)
|
|
type = models.ForeignKey(
|
|
ConnectionType,
|
|
on_delete=models.CASCADE,
|
|
null=True)
|
|
credentials = jsonfield.JSONField()
|
|
account = models.ForeignKey(Account, on_delete=models.CASCADE)
|
|
|
|
def __str__(self):
|
|
return f"{self.name}"
|