Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /Allura/allura/model/repository.py [9bfbf4] .. [dcb73d] Maximize Restore

  Switch to side-by-side view

--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -15,7 +15,9 @@
 
 from ming import schema as S
 from ming.utils import LazyProperty
-from ming.orm import MappedClass, FieldProperty, session
+from ming.orm import FieldProperty, session, Mapper
+from ming.orm.declarative import MappedClass
+
 
 from allura.lib.patience import SequenceMatcher
 from allura.lib import helpers as h
@@ -643,10 +645,8 @@
      # All repos that potentially reference this commit
     repositories=FieldProperty([S.ObjectId])
 
-    def __init__(self, **kw):
-        super(Commit, self).__init__(**kw)
-        # Ephemeral attrs
-        self.repo = None
+    # Ephemeral attrs
+    repo=None
 
     def set_context(self, repo):
         self.repo = repo
@@ -787,13 +787,11 @@
     type = FieldProperty(str, if_missing='tree')
     object_ids = FieldProperty([dict(object_id=str,name=str)])
 
-    def __init__(self, **kw):
-        super(Tree, self).__init__(**kw)
-        # Ephemeral attrs
-        self.repo = None
-        self.commit = None
-        self.parent = None
-        self.name = None
+    # Ephemeral attrs
+    repo=None
+    commit=None
+    parent=None
+    name=None
 
     def compute_hash(self):
         '''Compute a hash based on the contents of the tree.  Note that this
@@ -953,13 +951,11 @@
 
     type = FieldProperty(str, if_missing='blob')
 
-    def __init__(self, **kw):
-        super(Blob, self).__init__(**kw)
-        # Ephemeral attrs
-        self.repo = None
-        self.commit = None
-        self.tree = None
-        self.name = None
+    # Ephemeral attrs
+    repo=None
+    commit=None
+    tree=None
+    name=None
 
     def set_context(self, tree, name):
         self.repo = tree.repo
@@ -1179,4 +1175,4 @@
                 roots.append(child)
     assert not graph, 'Cycle detected'
 
-MappedClass.compile_all()
+Mapper.compile_all()