Files
andros d83cd58879 Add per-device sandbox flag for APNs environment selection
TestFlight builds use the production APNs endpoint, direct Xcode builds
use sandbox. Store is_sandbox on Device so each token hits the right host.
2026-05-19 10:11:32 +02:00

15 lines
428 B
Python

from django.db import models
class Device(models.Model):
feed = models.URLField(max_length=500)
device_token = models.CharField(max_length=200, unique=True)
is_sandbox = models.BooleanField(default=False)
created_at = models.DateTimeField(auto_now_add=True)
class Meta:
indexes = [models.Index(fields=["feed"])]
def __str__(self):
return f"{self.feed} -> {self.device_token[:10]}..."