[Pkg-debile-commits] [debile-master] 114/126: Remove some too complicated stuff in ORM madness

Sylvestre Ledru sylvestre at alioth.debian.org
Mon Aug 19 14:56:26 UTC 2013


This is an automated email from the git hooks/post-receive script.

sylvestre pushed a commit to branch scan-build-html
in repository debile-master.

commit 47843a8025f65a553e2854034035287764acbb33
Author: Léo Cavaillé <leo at cavaille.net>
Date:   Tue Aug 6 14:47:55 2013 +0200

    Remove some too complicated stuff in ORM madness
---
 lucy/orm.py |   22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/lucy/orm.py b/lucy/orm.py
index f7e1a9c..243137f 100644
--- a/lucy/orm.py
+++ b/lucy/orm.py
@@ -42,14 +42,12 @@ class Group(Base):
     id = Column(Integer, primary_key=True)
     name = Column(String(100))
 
+# Just so we can put either a Source package or a Binary package in a job
 class Package(Base):
     __tablename__ = 'packages'
     package_id = Column(Integer, primary_key=True)
     type = Column(String(30), nullable=False)
     __mapper_args__ = {'polymorphic_on': type}
-    group_id = Column(Integer, ForeignKey('groups.id'))
-    group = relationship("Group", backref=backref('packages', order_by=package_id))
-    run = Column(Integer)
 
 class Source(Package):
     __tablename__ = 'sources'
@@ -66,17 +64,20 @@ class Source(Package):
     user_id = Column(Integer, ForeignKey('users.id'))
     user = relationship("User", backref=backref('sources', order_by=name))
     dsc = Column(String(100))
+    group_id = Column(Integer, ForeignKey('groups.id'))
+    group = relationship("Group", backref=backref('packages', order_by=name))
+    run = Column(Integer)
     def serialize(self):
         source_dict = row2dict(self)
         source_dict['type'] = 'source'
         return source_dict
 
-class BinaryFiles(Base):
-    __tablename__ = 'binaryfiles'
-    id = Column(Integer, primary_key=True)
-    name =  Column(String(100))
-    binary_id = Column(Integer, ForeignKey('binaries.binary_id'), nullable=False)
-    binary = relationship("Binary", backref=backref('files', order_by=name))
+#class BinaryFiles(Base):
+#    __tablename__ = 'binaryfiles'
+#    id = Column(Integer, primary_key=True)
+#    name =  Column(String(100))
+#    binary_id = Column(Integer, ForeignKey('binaries.binary_id'), nullable=False)
+#    binary = relationship("Binary", backref=backref('files', order_by=name))
 
 class Binary(Package):
     __tablename__ = 'binaries'
@@ -89,6 +90,9 @@ class Binary(Package):
     updated_at = Column(DateTime)
     arch = Column(String(20), nullable=False)
     suite = Column(String(50), nullable=False)
+    group_id = Column(Integer, ForeignKey('groups.id'))
+    group = relationship("Group", backref=backref('packages', order_by=name))
+    run = Column(Integer)
     def serialize(self):
         binary_dict = row2dict(self)
         binary_dict['type'] = 'binary'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-debile/debile-master.git



More information about the Pkg-debile-commits mailing list