Child: [90e5f6] (diff)

Download this file

git.py    29 lines (21 with data), 652 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from ming.orm.mapped_class import MappedClass
from ming.orm.property import FieldProperty
from pyforge.model import Artifact
class Repository(Artifact):
class __mongometa__:
name='git-repository'
name=FieldProperty(str)
tool=FieldProperty(str)
path=FieldProperty(str)
status=FieldProperty(str)
def url(self):
return self.app_config.url() + self.name + '/'
def shorthand_id(self):
return self.name
def index(self):
result = Artifact.index(self)
result.update(
name_s=self.name,
type_s='GitRepository')
return result
MappedClass.compile_all()