mirror of
https://github.com/Dadechin/Dashboard-XRoom.git
synced 2025-07-03 16:54:35 +00:00
14 lines
561 B
Python
14 lines
561 B
Python
from django.db import models
|
|
from django.conf import settings
|
|
from core.models.AssetBundleRoom import AssetBundleRoom # Adjust import path if needed
|
|
|
|
class AssignRoomUser(models.Model):
|
|
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
|
|
assetbundle_room = models.ForeignKey(AssetBundleRoom, on_delete=models.CASCADE)
|
|
|
|
class Meta:
|
|
unique_together = ('user', 'assetbundle_room') # Prevent duplicate assignments
|
|
|
|
def __str__(self):
|
|
return f"{self.user.username} assigned to {self.assetbundle_room.name}"
|