Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
dashboard
Commits
0dfd7c54
Commit
0dfd7c54
authored
Jul 02, 2018
by
Guilhem Saurel
Browse files
Target.active
parent
b6dc13f6
Changes
4
Hide whitespace changes
Inline
Side-by-side
rainboard/admin.py
View file @
0dfd7c54
...
@@ -11,6 +11,7 @@ for model in [
...
@@ -11,6 +11,7 @@ for model in [
models
.
Robotpkg
,
models
.
Robotpkg
,
models
.
Image
,
models
.
Image
,
models
.
Tag
,
models
.
Tag
,
models
.
Target
,
models
.
Contributor
,
models
.
Contributor
,
models
.
ContributorName
,
models
.
ContributorName
,
models
.
ContributorMail
,
models
.
ContributorMail
,
...
...
rainboard/migrations/0019_target_active.py
0 → 100644
View file @
0dfd7c54
# Generated by Django 2.0.5 on 2018-07-02 09:39
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rainboard'
,
'0018_remove_target_python3'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'target'
,
name
=
'active'
,
field
=
models
.
BooleanField
(
default
=
True
),
),
]
rainboard/models.py
View file @
0dfd7c54
...
@@ -511,8 +511,15 @@ class Branch(TimeStampedModel):
...
@@ -511,8 +511,15 @@ class Branch(TimeStampedModel):
return
self
.
repo
.
namespace
return
self
.
repo
.
namespace
class
ActiveQuerySet
(
models
.
QuerySet
):
def
active
(
self
):
return
self
.
filter
(
active
=
True
)
class
Target
(
NamedModel
):
class
Target
(
NamedModel
):
pass
active
=
models
.
BooleanField
(
default
=
True
)
objects
=
ActiveQuerySet
.
as_manager
()
# class Test(TimeStampedModel):
# class Test(TimeStampedModel):
...
@@ -558,7 +565,7 @@ class Robotpkg(NamedModel):
...
@@ -558,7 +565,7 @@ class Robotpkg(NamedModel):
def
update_images
(
self
):
def
update_images
(
self
):
py3s
=
[
False
,
True
]
if
self
.
name
.
startswith
(
'py-'
)
else
[
False
]
py3s
=
[
False
,
True
]
if
self
.
name
.
startswith
(
'py-'
)
else
[
False
]
debugs
=
[
False
,
True
]
if
self
.
project
.
debug
else
[
False
]
debugs
=
[
False
,
True
]
if
self
.
project
.
debug
else
[
False
]
for
target
in
Target
.
objects
.
a
ll
():
for
target
in
Target
.
objects
.
a
ctive
():
for
py3
in
py3s
:
for
py3
in
py3s
:
for
debug
in
debugs
:
for
debug
in
debugs
:
Image
.
objects
.
get_or_create
(
robotpkg
=
self
,
target
=
target
,
py3
=
py3
,
debug
=
debug
)[
0
].
update
()
Image
.
objects
.
get_or_create
(
robotpkg
=
self
,
target
=
target
,
py3
=
py3
,
debug
=
debug
)[
0
].
update
()
...
...
rainboard/views.py
View file @
0dfd7c54
...
@@ -64,7 +64,7 @@ class ProjectImagesView(ProjectTableView):
...
@@ -64,7 +64,7 @@ class ProjectImagesView(ProjectTableView):
order_by
=
'target'
order_by
=
'target'
def
get_object_list
(
self
):
def
get_object_list
(
self
):
return
models
.
Image
.
objects
.
filter
(
robotpkg__project
=
self
.
object
)
return
models
.
Image
.
objects
.
filter
(
robotpkg__project
=
self
.
object
,
target__active
=
True
)
class
ProjectContributorsView
(
ProjectTableView
):
class
ProjectContributorsView
(
ProjectTableView
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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