You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to transfer data between application environments, and existing packages don't fit my use case. A great boon in doing so would be to be able to use Django's serialization framework for Wagtail models. Additionally, it would simplify test fixture generation.
Describe the solution you'd like
Some Wagtail models have a, well, natural natural key, in that they're looked up by it in normal site operation.
Site objects are looked up by hostname and port.
Page objects are looked up by url_path, which uniquely defines the hierarchy.
Some models feel like it should be workable, but I'm not sure:
Collection objects don't have materialized paths of any sort (except for MP_Node's). However, a list of names from root to self is likely a workable natural key.
Image model seems to be designed to have a one-to-one relationship with files, and file path could be a natural key. However, model users may adjust this behavior without overriding natural_key, so this is a potential incompatibility point.
Describe alternatives you've considered
Some libraries I've tried:
wagtail_import_export, wagtail_import_export_tool - don't support model references in StreamFields
wagtail_transfer - has problems with dependency loops that close over StreamFields
coderedcms - dropped export support.
Django serialization framework seems pretty great for this purpose, since it already knows how to load objects with circular dependencies.
Working on this
I'm probably going to do this anyway, but I feel the scope of this proposal is limited enough to be included upstream.
The text was updated successfully, but these errors were encountered:
Is your proposal related to a problem?
I'm trying to transfer data between application environments, and existing packages don't fit my use case. A great boon in doing so would be to be able to use Django's serialization framework for Wagtail models. Additionally, it would simplify test fixture generation.
Describe the solution you'd like
Some Wagtail models have a, well, natural natural key, in that they're looked up by it in normal site operation.
Site
objects are looked up by hostname and port.Page
objects are looked up byurl_path
, which uniquely defines the hierarchy.Some models feel like it should be workable, but I'm not sure:
Collection
objects don't have materialized paths of any sort (except forMP_Node
's). However, a list of names from root to self is likely a workable natural key.Image
model seems to be designed to have a one-to-one relationship with files, and file path could be a natural key. However, model users may adjust this behavior without overriding natural_key, so this is a potential incompatibility point.Describe alternatives you've considered
Some libraries I've tried:
wagtail_import_export
,wagtail_import_export_tool
- don't support model references in StreamFieldswagtail_transfer
- has problems with dependency loops that close over StreamFieldscoderedcms
- dropped export support.Django serialization framework seems pretty great for this purpose, since it already knows how to load objects with circular dependencies.
Working on this
I'm probably going to do this anyway, but I feel the scope of this proposal is limited enough to be included upstream.
The text was updated successfully, but these errors were encountered: