TypeTracking unique_together
This commit is contained in:
20
api/migrations/0003_alter_typetracking_unique_together.py
Normal file
20
api/migrations/0003_alter_typetracking_unique_together.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 5.0.6 on 2024-05-17 22:01
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('api', '0002_typetracking'),
|
||||
('sde', '0001_initial'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterUniqueTogether(
|
||||
name='typetracking',
|
||||
unique_together={('user', 'type')},
|
||||
),
|
||||
]
|
||||
@@ -18,3 +18,6 @@ class Acquisition(models.Model):
|
||||
class TypeTracking(models.Model):
|
||||
user = models.ForeignKey("auth.User", related_name="types_tracking", on_delete=models.CASCADE)
|
||||
type = models.ForeignKey(SDEType, related_name="tracked_by", on_delete=models.CASCADE)
|
||||
|
||||
class Meta:
|
||||
unique_together = [('user', 'type')]
|
||||
|
||||
@@ -29,7 +29,6 @@ class UserViewSet(viewsets.ReadOnlyModelViewSet):
|
||||
permission_classes = [permissions.IsAuthenticated]
|
||||
|
||||
|
||||
|
||||
class GroupViewSet(viewsets.ReadOnlyModelViewSet):
|
||||
"""
|
||||
API endpoint that allows groups to be viewed or edited.
|
||||
|
||||
Reference in New Issue
Block a user