Skip to content
GitLab
Menu
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
d0665715
Commit
d0665715
authored
Jan 12, 2018
by
Guilhem Saurel
Browse files
clone_url
parent
9fce739d
Changes
2
Show whitespace changes
Inline
Side-by-side
rainboard/migrations/0001_initial.py
View file @
d0665715
# Generated by Django 2.0.1 on 2018-01-12 1
0:31
# Generated by Django 2.0.1 on 2018-01-12 1
8:05
import
autoslug.fields
from
django.conf
import
settings
...
...
@@ -128,6 +128,7 @@ class Migration(migrations.Migration):
(
'open_pr'
,
models
.
PositiveSmallIntegerField
(
blank
=
True
,
null
=
True
)),
(
'repo_id'
,
models
.
PositiveIntegerField
()),
(
'forked_from'
,
models
.
PositiveIntegerField
(
blank
=
True
,
null
=
True
)),
(
'clone_url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'forge'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Forge'
)),
(
'license'
,
models
.
ForeignKey
(
blank
=
True
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
to
=
'rainboard.License'
)),
(
'namespace'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'rainboard.Namespace'
)),
...
...
rainboard/models.py
View file @
d0665715
...
...
@@ -168,6 +168,7 @@ class Repo(TimeStampedModel):
open_pr
=
models
.
PositiveSmallIntegerField
(
blank
=
True
,
null
=
True
)
repo_id
=
models
.
PositiveIntegerField
()
forked_from
=
models
.
PositiveIntegerField
(
blank
=
True
,
null
=
True
)
clone_url
=
models
.
URLField
(
max_length
=
200
,
blank
=
True
,
null
=
True
)
# TODO gitlab:
# description = models.TextField()
# created_at = models.DateTimeField()
...
...
@@ -206,6 +207,7 @@ class Repo(TimeStampedModel):
self
.
default_branch
=
data
[
'default_branch'
]
if
'forked_from_project'
in
data
:
self
.
forked_from
=
data
[
'forked_from_project'
][
'id'
]
self
.
clone_url
=
data
[
'http_url_to_repo'
]
self
.
save
()
def
api_update_github
(
self
,
data
):
...
...
@@ -220,6 +222,8 @@ class Repo(TimeStampedModel):
self
.
repo_id
=
data
[
'id'
]
if
'source'
in
data
:
self
.
forked_from
=
data
[
'source'
][
'id'
]
self
.
clone_url
=
data
[
'clone_url'
]
self
.
save
()
class
Commit
(
NamedModel
,
TimeStampedModel
):
...
...
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