Skip to content
Snippets Groups Projects
Verified Commit af4f5902 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

feat: add optional relation between User and Host

parent 6a09521d
No related branches found
No related tags found
No related merge requests found
# Generated by Django 4.2.2 on 2023-09-04 21:02
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("program", "0070_image_is_use_explicitly_granted_by_author"),
]
operations = [
migrations.AddField(
model_name="host",
name="owners",
field=models.ManyToManyField(
blank=True, related_name="hosts", to=settings.AUTH_USER_MODEL
),
),
]
...@@ -169,6 +169,7 @@ class Host(models.Model): ...@@ -169,6 +169,7 @@ class Host(models.Model):
image = models.ForeignKey(Image, null=True, on_delete=models.CASCADE, related_name="hosts") image = models.ForeignKey(Image, null=True, on_delete=models.CASCADE, related_name="hosts")
is_active = models.BooleanField(default=True) is_active = models.BooleanField(default=True)
name = models.CharField(max_length=128) name = models.CharField(max_length=128)
owners = models.ManyToManyField(User, blank=True, related_name="hosts")
updated_at = models.DateTimeField(auto_now=True, blank=True, null=True) updated_at = models.DateTimeField(auto_now=True, blank=True, null=True)
updated_by = models.CharField(blank=True, default="", max_length=150) updated_by = models.CharField(blank=True, default="", max_length=150)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment