Outfit
tibiawikisql.models.outfit
¶
Classes:
| Name | Description |
|---|---|
UnlockQuest |
A quest that unlocks the outfit and/or its addons. |
OutfitQuest |
Represents a quest that grants an outfit or it's addon. |
OutfitImage |
Represents an outfit image. |
Outfit |
Represents an outfit. |
UnlockQuest
pydantic-model
¶
Bases: BaseModel
A quest that unlocks the outfit and/or its addons.
Show JSON schema:
{
"description": "A quest that unlocks the outfit and/or its addons.",
"properties": {
"quest_id": {
"default": null,
"title": "Quest Id",
"type": "integer"
},
"quest_title": {
"title": "Quest Title",
"type": "string"
},
"unlock_type": {
"title": "Unlock Type",
"type": "string"
}
},
"required": [
"quest_title",
"unlock_type"
],
"title": "UnlockQuest",
"type": "object"
}
Fields:
-
quest_id(int) -
quest_title(str) -
unlock_type(str)
OutfitQuest
pydantic-model
¶
Bases: RowModel
Represents a quest that grants an outfit or it's addon.
Show JSON schema:
{
"description": "Represents a quest that grants an outfit or it's addon.",
"properties": {
"outfit_id": {
"title": "Outfit Id",
"type": "integer"
},
"outfit_title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Outfit Title"
},
"quest_id": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Quest Id"
},
"quest_title": {
"title": "Quest Title",
"type": "string"
},
"unlock_type": {
"title": "Unlock Type",
"type": "string"
}
},
"required": [
"outfit_id",
"quest_title",
"unlock_type"
],
"title": "OutfitQuest",
"type": "object"
}
Fields:
-
outfit_id(int) -
outfit_title(str | None) -
quest_id(int | None) -
quest_title(str) -
unlock_type(str)
OutfitImage
pydantic-model
¶
Represents an outfit image.
Show JSON schema:
{
"description": "Represents an outfit image.",
"properties": {
"image": {
"anyOf": [
{
"format": "binary",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Image"
},
"outfit_id": {
"title": "Outfit Id",
"type": "integer"
},
"outfit_name": {
"title": "Outfit Name",
"type": "string"
},
"sex": {
"title": "Sex",
"type": "string"
},
"addon": {
"title": "Addon",
"type": "integer"
}
},
"required": [
"outfit_id",
"outfit_name",
"sex",
"addon"
],
"title": "OutfitImage",
"type": "object"
}
Fields:
Outfit
pydantic-model
¶
Bases: WikiEntry, WithStatus, WithVersion, RowModel
Represents an outfit.
Show JSON schema:
{
"$defs": {
"OutfitImage": {
"description": "Represents an outfit image.",
"properties": {
"image": {
"anyOf": [
{
"format": "binary",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Image"
},
"outfit_id": {
"title": "Outfit Id",
"type": "integer"
},
"outfit_name": {
"title": "Outfit Name",
"type": "string"
},
"sex": {
"title": "Sex",
"type": "string"
},
"addon": {
"title": "Addon",
"type": "integer"
}
},
"required": [
"outfit_id",
"outfit_name",
"sex",
"addon"
],
"title": "OutfitImage",
"type": "object"
},
"UnlockQuest": {
"description": "A quest that unlocks the outfit and/or its addons.",
"properties": {
"quest_id": {
"default": null,
"title": "Quest Id",
"type": "integer"
},
"quest_title": {
"title": "Quest Title",
"type": "string"
},
"unlock_type": {
"title": "Unlock Type",
"type": "string"
}
},
"required": [
"quest_title",
"unlock_type"
],
"title": "UnlockQuest",
"type": "object"
}
},
"description": "Represents an outfit.",
"properties": {
"version": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Version"
},
"status": {
"title": "Status",
"type": "string"
},
"article_id": {
"title": "Article Id",
"type": "integer"
},
"title": {
"title": "Title",
"type": "string"
},
"timestamp": {
"format": "date-time",
"title": "Timestamp",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"outfit_type": {
"title": "Outfit Type",
"type": "string"
},
"is_premium": {
"title": "Is Premium",
"type": "boolean"
},
"is_bought": {
"title": "Is Bought",
"type": "boolean"
},
"is_tournament": {
"title": "Is Tournament",
"type": "boolean"
},
"full_price": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Full Price"
},
"achievement": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Achievement"
},
"images": {
"items": {
"$ref": "#/$defs/OutfitImage"
},
"title": "Images",
"type": "array"
},
"quests": {
"items": {
"$ref": "#/$defs/UnlockQuest"
},
"title": "Quests",
"type": "array"
}
},
"required": [
"version",
"status",
"article_id",
"title",
"timestamp",
"name",
"outfit_type",
"is_premium",
"is_bought",
"is_tournament",
"full_price",
"achievement"
],
"title": "Outfit",
"type": "object"
}
Fields:
-
version(str | None) -
status(str) -
article_id(int) -
title(str) -
timestamp(datetime) -
name(str) -
outfit_type(str) -
is_premium(bool) -
is_bought(bool) -
is_tournament(bool) -
full_price(int | None) -
achievement(str | None) -
images(list[OutfitImage]) -
quests(list[UnlockQuest])
is_tournament
pydantic-field
¶
is_tournament: bool
Whether the outfit can be bought with Tournament coins or not.
full_price
pydantic-field
¶
full_price: int | None
The full price of this outfit in the Tibia Store.
achievement
pydantic-field
¶
achievement: str | None
The achievement obtained for acquiring this full outfit.
insert
¶
insert(conn: Connection | Cursor) -> None
Insert the model into its respective database table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conn
|
Connection | Cursor
|
A cursor or connection to the database. |
required |
get_one_by_field
classmethod
¶
get_one_by_field(
conn: Connection | Cursor,
field: str,
value: Any,
use_like: bool = False,
) -> Self | None
Get a single element matching the field's value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conn
|
Connection | Cursor
|
A connection or cursor of the database. |
required |
field
|
str
|
The field to filter with. |
required |
value
|
Any
|
The value to look for. |
required |
use_like
|
bool
|
Whether to use |
False
|
Returns:
| Type | Description |
|---|---|
Self | None
|
The object found, or |
Raises:
| Type | Description |
|---|---|
ValueError
|
The specified field doesn't exist in the table. |