Checklist
Is your feature related to a problem? Please describe.
So, I have Vacancy table:
from enum import Enum
from sqlalchemy.orm import DeclarativeBase
class VacancyStatus(str, Enum):
DRAFT = 'draft'
ACTIVE = 'active'
INACTIVE = 'inactive'
ARCHIVED = 'archived'
DELETED = 'deleted'
PAUSED = 'paused'
EXPIRED = 'expired'
CLOSED = 'closed'
class Vacancy(DeclarativeBase):
__tablename__ = 'company_vacancy'
id: Mapped[int]
status: Mapped[VacancyStatus] = mapped_column(String, default=VacancyStatus.ACTIVE)
I have many unverified draft vacancies, which are later processed one by one. As they are many, I want to have two views in admin: Vacancy and DraftVacancy. I planned to separate with overriding list_query function, however, as it is the same class, I get the same identity, so URL is the same for both views.
Describe the solution you would like.
Enable to indicate identity as parameter. If not given, use slugify_class_name(obj.__class__.__name__).
Describe alternatives you considered
I had to create another class to bypass.
class DraftVacancy(Vacancy):
pass
And use a new view for this "new" class"
Additional context
SQLAdmin: v0.21.0
Checklist
Is your feature related to a problem? Please describe.
So, I have
Vacancytable:I have many unverified draft vacancies, which are later processed one by one. As they are many, I want to have two views in admin: Vacancy and DraftVacancy. I planned to separate with overriding
list_queryfunction, however, as it is the same class, I get the same identity, so URL is the same for both views.Describe the solution you would like.
Enable to indicate identity as parameter. If not given, use
slugify_class_name(obj.__class__.__name__).Describe alternatives you considered
I had to create another class to bypass.
And use a new view for this "new" class"
Additional context
SQLAdmin: v0.21.0