Skip to content

Unify Section.__init__ and Sectionable.create_section behavior #368

Closed

Description

@mpsonntag

The base.Sectionable class features a create_section method that allows the creation of a new Section from a Document or a Section and sets the new Section as the child of the calling parent.

The methods' arguments currently only include name, type and oid and features a different behaviour than the Sections own __init__ method:

  • name cannot be empty ; this should be changed to empty being default and allowed
  • type is by default set to undefined; this should also be changed to empty being default and allowed
  • all other attributes one can assign via Section.__init__ should also be assignable via the create_section method with the exception of parent.

When these changes are implemented, the section_type_undefined odml validation should be refactored: the check for string undefined should be removed and the warning message rephrased, since the above described behaviour is the only occurrence of setting the Section.type to undefined.

Activity

  1. self-assigned this
    on Apr 5, 2020
  2. mpsonntag commented on Apr 5, 2020

    @mpsonntag
    ContributorAuthor

    Section.__init__ and the Sectionable.create_section method will both by default set type="n.s.".

  3. added 2 commits that reference this issue on Apr 5, 2020
    5be208d
    aa73267
  4. added a commit that references this issue on Apr 8, 2020
    0c499da
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions