Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
feudal
feudalBackend
Commits
9a8cc0cb
Commit
9a8cc0cb
authored
Dec 15, 2017
by
Lukas Burgey
Browse files
Change service to site to m2m relation
parent
f123a8cf
Changes
1
Show whitespace changes
Inline
Side-by-side
django_backend/backend/models.py
View file @
9a8cc0cb
...
...
@@ -122,7 +122,7 @@ def deregister_at_rabbitmq(
class
Service
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
150
,
unique
=
True
)
description
=
models
.
TextField
(
max_length
=
300
,
blank
=
True
)
site
=
models
.
ForeignKey
(
site
=
models
.
ManyToManyField
(
Site
,
related_name
=
'services'
)
groups
=
models
.
ManyToManyField
(
...
...
@@ -131,7 +131,7 @@ class Service(models.Model):
blank
=
True
)
def
__str__
(
self
):
return
self
.
name
+
'@'
+
self
.
site
.
name
return
self
.
name
+
'@'
+
str
(
list
(
self
.
site
.
all
()))
class
SSHPublicKey
(
models
.
Model
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment