Skip to content

Commit

Permalink
sync 144
Browse files Browse the repository at this point in the history
  • Loading branch information
IJtLJZ8Rm4Yr committed May 16, 2023
1 parent b6b477c commit 1d2d17f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ymir/backend/src/ymir_app/app/crud/crud_dataset_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get_multi_dataset_groups(
is_desc = pagination.is_desc

query = db.query(self.model)
query = query.filter(self.model.user_id == user_id, self.model.visible_datasets, not_(self.model.is_deleted))
query = query.filter(self.model.user_id == user_id, self.model.datasets, not_(self.model.is_deleted))

if start_time and end_time:
_start_time = datetime.utcfromtimestamp(start_time)
Expand Down
2 changes: 1 addition & 1 deletion ymir/backend/src/ymir_app/app/crud/crud_model_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_multi_model_groups(
is_desc = pagination.is_desc

query = db.query(self.model)
query = query.filter(self.model.user_id == user_id, self.model.visible_models, not_(self.model.is_deleted))
query = query.filter(self.model.user_id == user_id, self.model.models, not_(self.model.is_deleted))

if start_time and end_time:
_start_time = datetime.utcfromtimestamp(start_time)
Expand Down
6 changes: 3 additions & 3 deletions ymir/backend/src/ymir_app/app/models/dataset_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ class DatasetGroup(Base):
project_id = Column(Integer, index=True, nullable=False)
user_id = Column(Integer, index=True, nullable=False)

datasets = relationship(
all_datasets = relationship(
"Dataset",
primaryjoin="foreign(Dataset.dataset_group_id)==DatasetGroup.id",
backref="group",
uselist=True,
viewonly=True,
)
visible_datasets = relationship(
datasets = relationship(
"Dataset",
primaryjoin="and_(foreign(Dataset.dataset_group_id)==DatasetGroup.id, foreign(Dataset.is_visible))",
uselist=True,
Expand All @@ -42,4 +42,4 @@ class DatasetGroup(Base):

@property
def is_visible(self) -> bool:
return bool(self.visible_datasets)
return bool(self.datasets)
6 changes: 3 additions & 3 deletions ymir/backend/src/ymir_app/app/models/model_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class ModelGroup(Base):
project_id = Column(Integer, index=True, nullable=False)
training_dataset_id = Column(Integer, index=True)

models = relationship(
all_models = relationship(
"Model",
primaryjoin="foreign(Model.model_group_id)==ModelGroup.id",
backref="group",
uselist=True,
viewonly=True,
)
visible_models = relationship(
models = relationship(
"Model",
primaryjoin="and_(foreign(Model.model_group_id)==ModelGroup.id, foreign(Model.is_visible))",
uselist=True,
Expand All @@ -43,4 +43,4 @@ class ModelGroup(Base):

@property
def is_visible(self) -> bool:
return bool(self.visible_models)
return bool(self.models)

0 comments on commit 1d2d17f

Please sign in to comment.