MCPcopy Index your code
hub / github.com/python-openxml/python-docx / CT_Num

Class CT_Num

src/docx/oxml/numbering.py:15–37  ·  view source on GitHub ↗

`` `` element, which represents a concrete list definition instance, having a required child that references an abstract numbering definition that defines most of the formatting details.

Source from the content-addressed store, hash-verified

13
14
15class CT_Num(BaseOxmlElement):
16 """``<w:num>`` element, which represents a concrete list definition instance, having
17 a required child <w:abstractNumId> that references an abstract numbering definition
18 that defines most of the formatting details."""
19
20 abstractNumId = OneAndOnlyOne("w:abstractNumId")
21 lvlOverride = ZeroOrMore("w:lvlOverride")
22 numId = RequiredAttribute("w:numId", ST_DecimalNumber)
23
24 def add_lvlOverride(self, ilvl):
25 """Return a newly added CT_NumLvl (<w:lvlOverride>) element having its ``ilvl``
26 attribute set to `ilvl`."""
27 return self._add_lvlOverride(ilvl=ilvl)
28
29 @classmethod
30 def new(cls, num_id, abstractNum_id):
31 """Return a new ``<w:num>`` element having numId of `num_id` and having a
32 ``<w:abstractNumId>`` child with val attribute set to `abstractNum_id`."""
33 num = OxmlElement("w:num")
34 num.numId = num_id
35 abstractNumId = CT_DecimalNumber.new("w:abstractNumId", abstractNum_id)
36 num.append(abstractNumId)
37 return num
38
39
40class CT_NumLvl(BaseOxmlElement):

Callers

nothing calls this directly

Calls 3

OneAndOnlyOneClass · 0.90
ZeroOrMoreClass · 0.90
RequiredAttributeClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…