mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
add only projects with project document
This commit is contained in:
parent
afa5aeff70
commit
68d1706cf4
1 changed files with 8 additions and 2 deletions
|
|
@ -661,8 +661,14 @@ class ProjectListWidget(QtWidgets.QWidget):
|
|||
self.current_project = None
|
||||
|
||||
if self.dbcon:
|
||||
for project_name in self.dbcon.database.collection_names():
|
||||
items.append(project_name)
|
||||
database = self.dbcon.database
|
||||
for project_name in database.collection_names():
|
||||
project_doc = database[project_name].find_one(
|
||||
{"type": "project"},
|
||||
{"name": 1}
|
||||
)
|
||||
if project_doc:
|
||||
items.append(project_doc["name"])
|
||||
for item in items:
|
||||
model.appendRow(QtGui.QStandardItem(item))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue