Skip to content

Unify Section.__init__ and Sectionable.create_section behavior #368

Closed
@mpsonntag

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.

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