Skip to content

Conversation

@soininen
Copy link
Contributor

@soininen soininen commented Oct 27, 2025

This PR adds a dock with an Entity table to Database editor. The table contains all entity data including location entries. Entities can be updated with the table. However, unlike the other stacked tables, Entity table does not have the empty rows and therefore it is not possible to add new entities from it. The feature was omitted because it is not yet clear if the table is useful in its current form.

Resolves #3088

Checklist before merging

  • Documentation is up-to-date
  • Release notes have been updated
  • Unit tests have been added/updated accordingly
  • Code has been formatted by black & isort
  • Unit tests pass

@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

❌ Patch coverage is 87.20539% with 76 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.00%. Comparing base (984670e) to head (38e581a).
⚠️ Report is 22 commits behind head on master.

Files with missing lines Patch % Lines
...toolbox/spine_db_editor/mvcmodels/single_models.py 87.57% 15 Missing and 5 partials ⚠️
...olbox/spine_db_editor/mvcmodels/compound_models.py 88.23% 4 Missing and 10 partials ⚠️
...olbox/spine_db_editor/widgets/custom_qtableview.py 84.81% 11 Missing and 1 partial ⚠️
...toolbox/spine_db_editor/widgets/spine_db_editor.py 56.25% 7 Missing ⚠️
spinetoolbox/parameter_type_validation.py 14.28% 6 Missing ⚠️
...oolbox/spine_db_editor/widgets/custom_delegates.py 53.84% 6 Missing ⚠️
...inetoolbox/spine_db_editor/widgets/custom_menus.py 58.33% 5 Missing ⚠️
spinetoolbox/spine_db_manager.py 50.00% 3 Missing and 1 partial ⚠️
spinetoolbox/widgets/custom_qtableview.py 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3203      +/-   ##
==========================================
+ Coverage   68.83%   69.00%   +0.17%     
==========================================
  Files         198      198              
  Lines       38342    38583     +241     
  Branches     4596     4631      +35     
==========================================
+ Hits        26391    26626     +235     
- Misses      10643    10647       +4     
- Partials     1308     1310       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@soininen soininen force-pushed the 3088_entity_location_table branch from b2636a5 to f90a865 Compare October 28, 2025 11:36
The models should not know anything about dock widgets.
The bookkeeping has been moved to SpineDBEditor where it
rightfully belongs.
- New Entity table contains all fields available in entities.
  The table currently lacks the empty table, so only updates
  are supported.
- Models now use field maps as the definitive source for available fields,
  field order and headers.

Re #3088
The fact that SpineDBManager.can_fetch_more() also registers the
fetch parent is very surprising and we should get rid of the feature.
This is a step towards that: compound table models now explicitly
register and unregister fetch parents when their database mappings
change. This simplifies canFetchMore() method considerably.
…table

Entity table now has proper delegates, copy/paste data converters and
SingleEntityTableModel.data() now returns sane data.

Re #3088
…ames immutable

Entity table shouldn't create entities on the fly as it is very confusing.
Also, make the entity_byname field fixed for 0-dimensional entities as
modifying this field doesn't really make much sense. To rename entities,
the "name" field can be used.

Re #3088
Empty Entity alternative table is now consistent with Parameter
value table.

Re #3088
Less conversions between field <-> column index <-> header.

Re #3088
The validation process could end up in an endless loop as proved
by the unit tests. This should fix the issue.

Re #3088
invalidateFilter() should be replaced by beginFilterChange() and
endFilterChange(). Further, invalidateFilter() is a protected method
in C++, not a slot, so we shouldn't connect a signal to it.

Re #3088
QSortFilterProxy.beginFilterChange() and endFilterChange() were
introduced in 6.9.

Re #3088
@soininen soininen force-pushed the 3088_entity_location_table branch from 2510f51 to 38e581a Compare October 29, 2025 08:25
@soininen soininen merged commit 6adb3b2 into master Oct 29, 2025
35 of 36 checks passed
@soininen soininen deleted the 3088_entity_location_table branch October 29, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the entity_location table explict in DB editor

2 participants