Cura/cura/Settings/DatabaseHandlers/IntentDatabaseHandler.py
Ghostkeeper 057ba8cdeb
Fix setting container type of subclasses
This mistake caused all of the container types to end up as either None or the actual instance itself, which was causing crashes.

Contributes to issue CURA-6096.
2021-09-08 15:46:25 +02:00

23 lines
1.1 KiB
Python

from UM.Settings.SQLQueryFactory import SQLQueryFactory
from UM.Settings.DatabaseContainerMetadataController import DatabaseMetadataContainerController
from UM.Settings.InstanceContainer import InstanceContainer
class IntentDatabaseHandler(DatabaseMetadataContainerController):
"""The Database handler for Intent containers"""
def __init__(self) -> None:
super().__init__(SQLQueryFactory(table = "intents",
fields = {
"id": "text",
"name": "text",
"quality_type": "text",
"intent_category": "text",
"variant": "text",
"definition": "text",
"material": "text",
"version": "text",
"setting_version": "text"
}))
self._container_type = InstanceContainer