Commit 9a8cc0cb authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Change service to site to m2m relation

parent f123a8cf
...@@ -122,7 +122,7 @@ def deregister_at_rabbitmq( ...@@ -122,7 +122,7 @@ def deregister_at_rabbitmq(
class Service(models.Model): class Service(models.Model):
name = models.CharField(max_length=150, unique=True) name = models.CharField(max_length=150, unique=True)
description = models.TextField(max_length=300, blank=True) description = models.TextField(max_length=300, blank=True)
site = models.ForeignKey( site = models.ManyToManyField(
Site, Site,
related_name='services') related_name='services')
groups = models.ManyToManyField( groups = models.ManyToManyField(
...@@ -131,7 +131,7 @@ class Service(models.Model): ...@@ -131,7 +131,7 @@ class Service(models.Model):
blank=True) blank=True)
def __str__(self): def __str__(self):
return self.name + '@' + self.site.name return self.name + '@' + str(list(self.site.all()))
class SSHPublicKey(models.Model): class SSHPublicKey(models.Model):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment