|
@@ -8,7 +8,6 @@ from datetime import datetime
|
|
|
|
|
|
from pycs import db
|
|
|
from pycs.database.Result import Result
|
|
|
-from pycs.database.Project import Project
|
|
|
from pycs.database.Collection import Collection
|
|
|
from pycs.database.base import NamedBaseModel
|
|
|
|
|
@@ -83,7 +82,7 @@ class File(NamedBaseModel):
|
|
|
|
|
|
:return: another file or None
|
|
|
"""
|
|
|
- return File.query.filter(*query)\
|
|
|
+ return self.project.files.filter(*query)\
|
|
|
.order_by(File.id.desc())\
|
|
|
.first()
|
|
|
|
|
@@ -93,7 +92,7 @@ class File(NamedBaseModel):
|
|
|
|
|
|
:return: another file or None
|
|
|
"""
|
|
|
- query = File.id > self.id, Project.id == self.project_id
|
|
|
+ query = File.id > self.id
|
|
|
return self._get_another_file(*query)
|
|
|
|
|
|
|
|
@@ -103,7 +102,7 @@ class File(NamedBaseModel):
|
|
|
|
|
|
:return: another file or None
|
|
|
"""
|
|
|
- query = File.id < self.id, Project.id == self.project_id
|
|
|
+ query = File.id < self.id
|
|
|
return self._get_another_file(*query)
|
|
|
|
|
|
|
|
@@ -113,7 +112,7 @@ class File(NamedBaseModel):
|
|
|
|
|
|
:return: another file or None
|
|
|
"""
|
|
|
- query = File.id > self.id, Project.id == self.project_id, Collection.id == self.collection_id
|
|
|
+ query = File.id > self.id, Collection.id == self.collection_id
|
|
|
return self._get_another_file(*query)
|
|
|
|
|
|
|
|
@@ -123,7 +122,7 @@ class File(NamedBaseModel):
|
|
|
|
|
|
:return: another file or None
|
|
|
"""
|
|
|
- query = File.id < self.id, Project.id == self.project_id, Collection.id == self.collection_id
|
|
|
+ query = File.id < self.id, Collection.id == self.collection_id
|
|
|
return self._get_another_file(*query)
|
|
|
|
|
|
|