mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-20 23:41:20 +00:00
Join
This commit is contained in:
parent
18ae6bacb0
commit
d7886eb773
1 changed files with 3 additions and 3 deletions
|
@ -568,7 +568,7 @@ class PartStudentView(SecureAdminModelView):
|
|||
|
||||
|
||||
def partStudentQueryFactory():
|
||||
return PartStudent.query.filter(PartStudent.part.has(Part.semester == current_user.active_semester))
|
||||
return PartStudent.query.join(Part).where(Part.semester == current_user.active_semester)
|
||||
|
||||
|
||||
class ProgramRowFilter(FilterEqual):
|
||||
|
@ -589,12 +589,12 @@ class GroupView(SecureAdminModelView):
|
|||
if is_created:
|
||||
|
||||
def query_factory():
|
||||
return partStudentQueryFactory().filter(PartStudent.group == None)
|
||||
return partStudentQueryFactory().where(PartStudent.group == None)
|
||||
|
||||
else:
|
||||
|
||||
def query_factory():
|
||||
return partStudentQueryFactory().filter(
|
||||
return partStudentQueryFactory().where(
|
||||
or_(
|
||||
and_(PartStudent.group == None, PartStudent.part.has(Part.program == group.program)),
|
||||
PartStudent.group == group,
|
||||
|
|
Loading…
Reference in a new issue