Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /MTSWebServices_syncmaster /syncmaster /db /models /queue.py
| # SPDX-FileCopyrightText: 2023-present MTS PJSC | |
| # SPDX-License-Identifier: Apache-2.0 | |
| from __future__ import annotations | |
| from sqlalchemy import Computed, String | |
| from sqlalchemy.dialects.postgresql import TSVECTOR | |
| from sqlalchemy.orm import Mapped, mapped_column, relationship | |
| from syncmaster.db.mixins import ResourceMixin, TimestampMixin | |
| from syncmaster.db.models.base import Base | |
| from syncmaster.db.models.group import Group | |
| class Queue(Base, ResourceMixin, TimestampMixin): | |
| __tablename__ = "queue" | |
| name: Mapped[str] = mapped_column(String(128), nullable=False) | |
| slug: Mapped[str] = mapped_column(String(256), nullable=False, unique=True) | |
| group: Mapped[Group] = relationship(viewonly=True) | |
| search_vector: Mapped[str] = mapped_column( | |
| TSVECTOR, | |
| Computed( | |
| """ | |
| -- === NAME FIELD === | |
| -- Russian stemming for better morphological matching of regular words | |
| to_tsvector('russian', coalesce(name, '')) | |
| -- Simple dictionary (no stemming) for exact token match | |
| || to_tsvector('simple', coalesce(name, '')) | |
| -- Simple dictionary with translate(): split by . / - _ : \ | |
| -- (used when 'name' contains technical fields) | |
| || to_tsvector( | |
| 'simple', | |
| translate(coalesce(name, ''), './-_:\\', ' ') | |
| ) | |
| """, | |
| persisted=True, | |
| ), | |
| nullable=False, | |
| deferred=True, | |
| ) | |
| def __repr__(self): | |
| return f"<Queue name={self.name} slug={self.slug} description={self.description}>" | |
Xet Storage Details
- Size:
- 1.6 kB
- Xet hash:
- 85e3f152cf079f1bdc6d3bc2759aba9d4df2e1c44cd585e7191e7a294b26960c
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.