Imbuement
tibiawikisql.models.imbuement
¶
Classes:
| Name | Description |
|---|---|
Material |
A material needed to use this imbuement. |
ImbuementMaterial |
Represents an item material for an imbuement. |
Imbuement |
Represents an imbuement type. |
Material
pydantic-model
¶
Bases: BaseModel
A material needed to use this imbuement.
Show JSON schema:
{
"description": "A material needed to use this imbuement.",
"properties": {
"item_id": {
"default": 0,
"title": "Item Id",
"type": "integer"
},
"item_title": {
"title": "Item Title",
"type": "string"
},
"amount": {
"title": "Amount",
"type": "integer"
}
},
"required": [
"item_title",
"amount"
],
"title": "Material",
"type": "object"
}
Fields:
ImbuementMaterial
pydantic-model
¶
Bases: RowModel
Represents an item material for an imbuement.
Show JSON schema:
{
"description": "Represents an item material for an imbuement.",
"properties": {
"imbuement_id": {
"title": "Imbuement Id",
"type": "integer"
},
"imbuement_title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Imbuement Title"
},
"item_id": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Item Id"
},
"item_title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Item Title"
},
"amount": {
"title": "Amount",
"type": "integer"
}
},
"required": [
"imbuement_id",
"amount"
],
"title": "ImbuementMaterial",
"type": "object"
}
Fields:
-
imbuement_id(int) -
imbuement_title(str | None) -
item_id(int | None) -
item_title(str | None) -
amount(int)
Imbuement
pydantic-model
¶
Bases: WikiEntry, WithStatus, WithVersion, WithImage, RowModel
Represents an imbuement type.
Show JSON schema:
{
"$defs": {
"Material": {
"description": "A material needed to use this imbuement.",
"properties": {
"item_id": {
"default": 0,
"title": "Item Id",
"type": "integer"
},
"item_title": {
"title": "Item Title",
"type": "string"
},
"amount": {
"title": "Amount",
"type": "integer"
}
},
"required": [
"item_title",
"amount"
],
"title": "Material",
"type": "object"
}
},
"description": "Represents an imbuement type.",
"properties": {
"image": {
"anyOf": [
{
"format": "binary",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Image"
},
"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"
},
"tier": {
"title": "Tier",
"type": "string"
},
"type": {
"title": "Type",
"type": "string"
},
"category": {
"title": "Category",
"type": "string"
},
"effect": {
"title": "Effect",
"type": "string"
},
"slots": {
"title": "Slots",
"type": "string"
},
"materials": {
"items": {
"$ref": "#/$defs/Material"
},
"title": "Materials",
"type": "array"
}
},
"required": [
"version",
"status",
"article_id",
"title",
"timestamp",
"name",
"tier",
"type",
"category",
"effect",
"slots"
],
"title": "Imbuement",
"type": "object"
}
Fields:
-
image(bytes | None) -
version(str | None) -
status(str) -
article_id(int) -
title(str) -
timestamp(datetime) -
name(str) -
tier(str) -
type(str) -
category(str) -
effect(str) -
slots(str) -
materials(list[Material])
insert
¶
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. |