Browse Source

typing + rename as private

Guénaël Muller 6 years ago
parent
commit
6e9485c834
2 changed files with 6 additions and 6 deletions
  1. 4 4
      tracim/lib/core/content.py
  2. 2 2
      tracim/models/data.py

+ 4 - 4
tracim/lib/core/content.py View File

@@ -161,14 +161,14 @@ class ContentApi(object):
161 161
             self._show_deleted = previous_show_deleted
162 162
             self._show_temporary = previous_show_temporary
163 163
 
164
-    def get_content_in_context(self, content: Content):
164
+    def get_content_in_context(self, content: Content) -> ContentInContext:
165 165
         return ContentInContext(content, self._session, self._config)
166 166
 
167
-    def get_revision_in_context(self, revision: ContentRevisionRO):
167
+    def get_revision_in_context(self, revision: ContentRevisionRO) -> RevisionInContext:  # nopep8
168 168
         # TODO - G.M - 2018-06-173 - create revision in context object
169 169
         return RevisionInContext(revision, self._session, self._config)
170 170
     
171
-    def get_revision_join(self) -> sqlalchemy.sql.elements.BooleanClauseList:
171
+    def _get_revision_join(self) -> sqlalchemy.sql.elements.BooleanClauseList:
172 172
         """
173 173
         Return the Content/ContentRevision query join condition
174 174
         :return: Content/ContentRevision query join condition
@@ -187,7 +187,7 @@ class ContentApi(object):
187 187
         :return: Content/ContentRevision Query
188 188
         """
189 189
         return self._session.query(Content)\
190
-            .join(ContentRevisionRO, self.get_revision_join())
190
+            .join(ContentRevisionRO, self._get_revision_join())
191 191
 
192 192
     @classmethod
193 193
     def sort_tree_items(

+ 2 - 2
tracim/models/data.py View File

@@ -812,9 +812,9 @@ class Content(DeclarativeBase):
812 812
     # QUERY CONTENTS
813 813
 
814 814
     To query contents you will need to join your content query with ContentRevisionRO. Join
815
-    condition is available at tracim.lib.content.ContentApi#get_revision_join:
815
+    condition is available at tracim.lib.content.ContentApi#_get_revision_join:
816 816
 
817
-    content = DBSession.query(Content).join(ContentRevisionRO, ContentApi.get_revision_join())
817
+    content = DBSession.query(Content).join(ContentRevisionRO, ContentApi._get_revision_join())
818 818
                   .filter(Content.label == 'foo')
819 819
                   .one()
820 820