-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from oarepo/checkfield
Checkfield
- Loading branch information
Showing
7 changed files
with
64 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
oarepo_model_builder_drafts/invenio/invenio_drafts_has_draft_checkfield.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from oarepo_model_builder.invenio.invenio_base import InvenioBaseClassPythonBuilder | ||
|
||
|
||
class InvenioDraftsHasDraftCheckfieldBuilder(InvenioBaseClassPythonBuilder): | ||
TYPE = "invenio_drafts_has_draft_checkfield" | ||
section = "record" | ||
template = "drafts-has-draft-checkfield" | ||
|
||
def finish(self, **extra_kwargs): | ||
super().finish(parent_record=self.current_model.parent_record, **extra_kwargs) |
6 changes: 6 additions & 0 deletions
6
oarepo_model_builder_drafts/invenio/templates/invenio_drafts_has_draft_checkfield.py.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from oarepo_runtime.drafts.systemfields.has_draftcheck import HasDraftCheckField | ||
|
||
class {{ vars.record|class_header }}: | ||
has_draft = HasDraftCheckField(config_key="HAS_DRAFT_CUSTOM_FIELD") | ||
|
||
{{ parent_record.record.class|base_name }}.has_draft = HasDraftCheckField(draft_cls={{ vars.record.class|base_name }}, config_key="HAS_DRAFT_CUSTOM_FIELD") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[metadata] | ||
name = oarepo-model-builder-drafts | ||
version = 4.0.0 | ||
version = 4.0.1 | ||
description = | ||
authors = Ronald Krist <[email protected]> | ||
readme = README.md | ||
|
@@ -40,6 +40,7 @@ oarepo_model_builder.builders.draft: | |
0340-invenio_record_dumper = oarepo_model_builder.invenio.invenio_record_dumper:InvenioRecordDumperBuilder | ||
2800-invenio_drafts_record_metadata_extra_fields = oarepo_model_builder_drafts.invenio.invenio_drafts_record_metadata_extra_fields:InvenioDraftsRecordMetadataExtraFieldsBuilder | ||
2900-invenio_drafts_record_extra_fields = oarepo_model_builder_drafts.invenio.invenio_drafts_record_extra_fields:InvenioDraftsRecordExtraFieldsBuilder | ||
3000-invenio_drafts_has_draft_checkfield = oarepo_model_builder_drafts.invenio.invenio_drafts_has_draft_checkfield:InvenioDraftsHasDraftCheckfieldBuilder | ||
5150-invenio_drafts_parent_state = oarepo_model_builder_drafts.invenio.invenio_drafts_parent_state:InvenioDraftsParentStateBuilder | ||
5200-invenio_drafts_record_service_config = oarepo_model_builder_drafts.invenio.invenio_drafts_record_service_config:InvenioDraftsRecordServiceConfigBuilder | ||
3500-invenio_drafts_setup_cfg = oarepo_model_builder_drafts.invenio.invenio_drafts_setup_cfg:InvenioDraftsSetupCfgBuilder | ||
|