Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WCM-271: Basic mechanics for gradually moving metadata into individual columns #829

Merged
merged 9 commits into from
Aug 13, 2024

Conversation

wosc
Copy link
Member

@wosc wosc commented Aug 12, 2024

No description provided.

@wosc wosc force-pushed the WCM-271-column-mechanics branch 6 times, most recently from a0ac5a0 to e28907c Compare August 12, 2024 14:44
We need to differentiate properties that already have been migrated to
columns from those that still remain in unsorted, for the transition
period. And we can only determine this information via ns+name,
especially in the `toProperty` case (in `fromProperty` we might have
annotated the value returned by connector, or something).
Since we base Resource.type on properties[meta:type] anyway, put the
heuristics for meta:type in get_properties, instead of bolting them on
afterwards.
…/timestamp)

We treat SQL connector as the new default, and update filesystem/mock to behave similarly
for column in self._columns_with_name():
namespace, name = column.info['namespace'], column.info['name']
value = props.get((name, self.NS + namespace), self)
if value is not self:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warum genau haben wir self als default gewählt? also anstatt None?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weil None als Wert grundsätzlich möglich ist. self als Marker für "war nicht im dict" zu nehmen ist so ein Python-"Trick", man könnte das Ganze natürlich auch mit if key in properties:... aufschreiben statt mit get(), oder mit einem expliziten MISSING = object() Marker, oder oder oder.

resource = self.repository.connector['http://xml.zeit.de/testcontent']
self.assertIs(
True, resource.properties[('overscrolling', 'http://namespaces.zeit.de/CMS/document')]
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wir haben auch eine Unicode Property umgezogen, theoretisch fehlt dafür ein ConvertTest. Auch wenns implizit in PropertiesColumnTest mit getestet wird.

bases=(zeit.cms.testing.CONFIG_LAYER, SQL_CONFIG_LAYER),
)
SQL_CONTENT_ZOPE_LAYER = zeit.cms.testing.ZopeLayer(bases=(SQL_CONTENT_ZCML_LAYER,))
SQL_CONTENT_LAYER = SQLDatabaseLayer(bases=(SQL_CONTENT_ZOPE_LAYER,))
Copy link
Contributor

@louika louika Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layers 🥳

Copy link
Contributor

@louika louika left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤞

@louika louika merged commit 62fcf8e into main Aug 13, 2024
4 checks passed
@louika louika deleted the WCM-271-column-mechanics branch August 13, 2024 13:40
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.

2 participants