Skip to content

bolig_ping.data_models

source module bolig_ping.data_models

Data models used in the project.

Classes

source class SearchQuery(**data: Any)

Bases : BaseModel

A search query.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Attributes

  • model_config : ClassVar[ConfigDict] Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

  • model_extra : dict[str, Any] | None Get extra fields set during validation.

  • model_fields_set : set[str] Returns the set of fields that have been explicitly set on this model instance.

Methods

  • is_empty Check if the search query is empty.

  • get_url Get the URL for the search query.

source method SearchQuery.is_empty()bool

Check if the search query is empty.

Returns

  • bool True if the search query is empty, False otherwise.

source method SearchQuery.get_url(page: int = 1)str

Get the URL for the search query.

Parameters

  • page : optional The page number to get the URL for. Defaults to 1.

Returns

  • str The URL for the search query.

source class Home(**data: Any)

Bases : BaseModel

A property listing.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Attributes

  • model_config : ClassVar[ConfigDict] Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

  • model_extra : dict[str, Any] | None Get extra fields set during validation.

  • model_fields_set : set[str] Returns the set of fields that have been explicitly set on this model instance.

  • description : str | None Get the description of the home.

Methods

  • to_html Get the home as an HTML string.

  • to_text Get the home as a text string.

source property Home.description: str | None

Get the description of the home.

Returns

  • str | None The description of the home, or None if not available.

source method Home.to_html()str

Get the home as an HTML string.

Returns

  • str The home as an HTML string.

source method Home.to_text()str

Get the home as a text string.

Returns

  • str The home as a text string.