Skip to content

Topics

Topic

Bases: ResponseModel

Represents a topic in CTFd.

Parameters:

Name Type Description Default
id int

The ID of the topic

required
value str

The value of the topic

required

Attributes:

Name Type Description
id int

The ID of the topic, read-only

value str

The value of the topic

Source code in ctfdpy\models\topics.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class Topic(ResponseModel):
    """
    Represents a topic in CTFd.

    Parameters
    ----------
    id : int
        The ID of the topic
    value : str
        The value of the topic

    Attributes
    ----------
    id : int
        The ID of the topic, read-only
    value : str
        The value of the topic
    """

    id: int = Field(frozen=True, exclude=True)
    value: str

ChallengeTopicReference

Bases: ResponseModel

Represents a reference to a topic for a challenge in CTFd.

Parameters:

Name Type Description Default
id int

The ID of the challenge-topic reference

required
challenge int

Alias for challenge_id

required
challenge_id int

The ID of the challenge associated with the topic

required
topic int

Alias for topic_id

required
topic_id int

The ID of the topic associated with the challenge

required

Attributes:

Name Type Description
id int

The ID of the challenge-topic reference, read-only

challenge_id int

The ID of the challenge associated with the topic

topic_id int

The ID of the topic associated with the challenge

Source code in ctfdpy\models\topics.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
class ChallengeTopicReference(ResponseModel):
    """
    Represents a reference to a topic for a challenge in CTFd.

    Parameters
    ----------
    id : int
        The ID of the challenge-topic reference
    challenge : int
        Alias for `challenge_id`
    challenge_id : int
        The ID of the challenge associated with the topic
    topic : int
        Alias for `topic_id`
    topic_id : int
        The ID of the topic associated with the challenge

    Attributes
    ----------
    id : int
        The ID of the challenge-topic reference, read-only
    challenge_id : int
        The ID of the challenge associated with the topic
    topic_id : int
        The ID of the topic associated with the challenge
    """

    id: int = Field(frozen=True, exclude=True)
    challenge_id: int = Field(
        validation_alias=AliasChoices("challenge_id", "challenge")
    )
    topic_id: int = Field(validation_alias=AliasChoices("topic_id", "topic"))