~romaimperator/keryx/devel

« back to all changes in this revision

Viewing changes to libkeryx/definitions/dpkg/database.py

  • Committer: Chris Oliver
  • Date: 2009-09-18 01:40:26 UTC
  • Revision ID: excid3@gmail.com-20090918014026-ox4k932l03rsl2re
Project and repository relationship creating working

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
    project_id = Column(Integer, ForeignKey(Project.c.id))
13
13
    type = Column(String) # installed/removed/etc
14
14
    target_id = Column(Integer)
 
15
    status = Column(String)
15
16
    
16
17
    project = relation(Project, backref=backref('relations', order_by=id))
17
18
    
18
 
    def __init__(self, type, target_id):
 
19
    def __init__(self, type, target_id, status=None):
19
20
        #self.project_id = project_id
20
21
        self.type = type
21
22
        self.target_id = target_id
 
23
        self.status = status
22
24
        
23
25
        
24
26
    def __repr__(self):
25
 
        return "<Relation('%s','%s','%s')>" % (self.project_id, self.type,
26
 
                                            self.target_id)
 
27
        return "<Relation('%s','%s','%s','%s')>" % (self.project_id, self.type,
 
28
                                            self.target_id, self.status)
27
29
 
28
30
 
29
31
class Repo(libkeryx.Base):
33
35
    id = Column(Integer, primary_key=True)
34
36
    type = Column(String) #deb, deb-src, etc
35
37
    url = Column(String)
 
38
    dist = Column(String)
 
39
    sections = Column(String)
36
40
 
37
41
  
38
 
    def __init__(self, type, url):
 
42
    def __init__(self, type, url, dist, sections):
39
43
        self.type = type
40
44
        self.url = url
 
45
        self.dist = dist
 
46
        self.sections = sections
41
47
 
42
48
    
43
49
    def __repr__(self):
44
 
        return "<Repo('%s','%s')>" % (self.type, self.url)
 
50
        return "<Repo('%s','%s','%s','%s')>" % (self.type, self.url, self.dist, 
 
51
                                      self.sections)
45
52
 
46
53
 
47
54
class Package(libkeryx.Base):