-
Notifications
You must be signed in to change notification settings - Fork 4
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
Conversation
a0ac5a0
to
e28907c
Compare
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
e28907c
to
1040574
Compare
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: |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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')] | ||
) |
There was a problem hiding this comment.
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,)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layers 🥳
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.