Open markotoplak opened 6 months ago
The above case is almost solved by specifying:
v2 = ContextSetting(None, exclude_attributes=True)
The only remaining problem is that exclude_attributes
effectively means exclude_attributes_or_classes.
Therefore, if a class var is set as v2, then the resulting context will never be matched.
However, because exclude_*
is never checked for PERFECT_MATCH, the solution with exclude_attributes=True
still allows the user to properly save and load the workflow even if v2 was a class variable. It is just that that particular context will match nowhere.
For remembering states of combo boxes where we choose features we tend to use contexts. We frequently use
DomainContext
, which works well most of the time.It works so well that I did not notice, until now, that it is not appropriate if combo boxes within the widget are limited to a different subset of (attributes, class_vars, metas).
Here is an example:
Running the test gives:
Is this a bug in DomainContextHandler? No, it is how it was designed; it is just that I was using it wrongly. For this kind of situations, I'll need a new type of context.
PerfectDomainContextHandler
does not exhibit the same issue but is too restrictive. I'll need something in between.It is a bug that contexts that match and could not be opened effectively (for any reason) block you from using the widget with that data? Probably. :) When this happens, the only solutions is to clear the settings.