Commit bc1e1dae4d8c85f399c20dc8c78988c9e80d74f5
Committed by
Lucas Kanashiro
1 parent
a2cad50a
Exists in
master
and in
27 other branches
Added GitlabGroup model
Signed-off-by: Matheus Fernandes <matheus.souza.fernandes@gmail.com> Signed-off-by: Lucas Moura <lucas.moura128@gmail.com>
Showing
1 changed file
with
18 additions
and
0 deletions
Show diff stats
colab/plugins/gitlab/models.py
| @@ -24,6 +24,24 @@ class GitlabProject(models.Model, HitCounterModelMixin): | @@ -24,6 +24,24 @@ class GitlabProject(models.Model, HitCounterModelMixin): | ||
| 24 | verbose_name_plural = _('Gitlab Projects') | 24 | verbose_name_plural = _('Gitlab Projects') |
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | +class GitlabGroup(models.Model): | ||
| 28 | + id = models.IntegerField(primary_key=True) | ||
| 29 | + name = models.CharField(max_length=100) | ||
| 30 | + path = models.CharField(max_length=100) | ||
| 31 | + owner_id = models.IntegerField(null=True) | ||
| 32 | + | ||
| 33 | + def __unicode__(self): | ||
| 34 | + return u'{}'.format(self.path) | ||
| 35 | + | ||
| 36 | + @property | ||
| 37 | + def url(self): | ||
| 38 | + return u'/gitlab/groups/{}'.format(self.id) | ||
| 39 | + | ||
| 40 | + class Meta: | ||
| 41 | + verbose_name = _('Gitlab Group') | ||
| 42 | + verbose_name_plural = _('Gitlab Groups') | ||
| 43 | + | ||
| 44 | + | ||
| 27 | class GitlabMergeRequest(Collaboration): | 45 | class GitlabMergeRequest(Collaboration): |
| 28 | 46 | ||
| 29 | id = models.IntegerField(primary_key=True) | 47 | id = models.IntegerField(primary_key=True) |