2024-12-31 10:38:15 -05:00
|
|
|
from django.db import models
|
|
|
|
from django.contrib.auth import get_user_model
|
2025-01-02 13:34:51 -05:00
|
|
|
import uuid
|
2024-12-31 10:38:15 -05:00
|
|
|
|
|
|
|
User = get_user_model()
|
|
|
|
|
|
|
|
class ImmichIntegration(models.Model):
|
|
|
|
server_url = models.CharField(max_length=255)
|
|
|
|
api_key = models.CharField(max_length=255)
|
2025-01-02 13:34:51 -05:00
|
|
|
user = models.ForeignKey(
|
|
|
|
User, on_delete=models.CASCADE)
|
|
|
|
id = models.UUIDField(default=uuid.uuid4, editable=False, unique=True, primary_key=True)
|
2024-12-31 10:38:15 -05:00
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.user.username + ' - ' + self.server_url
|