2018-04-24 00:16:22 +02:00
|
|
|
from django.db import models
|
|
|
|
from django.conf import settings
|
|
|
|
|
|
|
|
class Client(models.Model):
|
|
|
|
name = models.TextField(default = "brutaldon")
|
2018-04-24 18:55:44 +02:00
|
|
|
api_base_id = models.URLField(default="https://mastodon.social")
|
2018-04-24 00:16:22 +02:00
|
|
|
client_id = models.TextField(null=True, blank=True)
|
|
|
|
client_secret = models.TextField(null=True, blank=True)
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.name + ": " + self.api_base_id
|
|
|
|
|
|
|
|
class Account(models.Model):
|
2018-04-24 20:49:43 +02:00
|
|
|
username = models.EmailField()
|
2018-04-24 00:16:22 +02:00
|
|
|
django_user = models.ForeignKey(settings.AUTH_USER_MODEL, models.CASCADE, null=True)
|
|
|
|
access_token = models.TextField(null=True, blank=True)
|
2018-04-24 18:55:44 +02:00
|
|
|
client= models.ForeignKey(Client, models.SET_NULL, null=True)
|