-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrepository.py
More file actions
36 lines (31 loc) · 966 Bytes
/
repository.py
File metadata and controls
36 lines (31 loc) · 966 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
29
30
31
32
33
34
35
36
"""
file: repository.py
author: Ben Grawi <bjg1568@rit.edu>
date: October 2013
description: Holds the repository abstraction class and ORM
"""
import uuid
from db import *
from datetime import datetime
class Repository(Base):
"""
Commit():
description: The SQLAlchemy ORM for the repository table
"""
__tablename__ = 'repositories'
id = Column(String, primary_key=True)
name = Column(String)
url = Column(String)
creation_date = Column(String)
ingestion_date = Column(String)
analysis_date = Column(String)
email = Column(String)
def __init__(self, repoDict):
"""
__init__(): Dictonary -> NoneType
"""
self.id = str(uuid.uuid1())
self.creation_date = str(datetime.now().replace(microsecond=0))
self.__dict__.update(repoDict)
def __repr__(self):
return "<Repository: %s - %s>" % (self.name, self.id)