mirror of
https://github.com/correl/codereview.git
synced 2024-11-24 03:00:07 +00:00
17 lines
437 B
Python
17 lines
437 B
Python
|
from django.db import models
|
||
|
from codereview.lib import vcs
|
||
|
|
||
|
class Repository(models.Model):
|
||
|
Types = {
|
||
|
'Git': 0,
|
||
|
}
|
||
|
name = models.CharField(max_length=200, unique=True)
|
||
|
path = models.CharField(max_length=255)
|
||
|
type = models.IntegerField(default=0)
|
||
|
|
||
|
def get_vcs(self):
|
||
|
if self.type == 0:
|
||
|
return vcs.Git(self.path)
|
||
|
else:
|
||
|
raise Exception('Invalid VCS type')
|