Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
e0c3b564
Commit
e0c3b564
authored
Dec 11, 2012
by
Sofia Papagiannaki
Browse files
Set unique together resource name and service
parent
180ad7d5
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/migrations/0036_auto__del_unique_resource_name__add_unique_resource_name_service.py
0 → 100644
View file @
e0c3b564
This diff is collapsed.
Click to expand it.
snf-astakos-app/astakos/im/models.py
View file @
e0c3b564
...
...
@@ -157,12 +157,15 @@ class ResourceMetadata(models.Model):
class
Resource
(
models
.
Model
):
name
=
models
.
CharField
(
_
(
'Name'
),
max_length
=
255
,
unique
=
True
,
db_index
=
True
)
name
=
models
.
CharField
(
_
(
'Name'
),
max_length
=
255
)
meta
=
models
.
ManyToManyField
(
ResourceMetadata
)
service
=
models
.
ForeignKey
(
Service
)
desc
=
models
.
TextField
(
_
(
'Description'
),
null
=
True
)
unit
=
models
.
CharField
(
_
(
'Name'
),
null
=
True
,
max_length
=
255
)
group
=
models
.
CharField
(
_
(
'Group'
),
null
=
True
,
max_length
=
255
)
class
Meta
:
unique_together
=
(
"name"
,
"service"
)
def
__str__
(
self
):
return
'%s%s%s'
%
(
self
.
service
,
RESOURCE_SEPARATOR
,
self
.
name
)
...
...
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