Skip to content

Commit

Permalink
chore(topics): fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
nsantacruz committed Dec 7, 2024
1 parent 79ed249 commit 7d40f2c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions django_topics/models/topic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from django.db import models
from django.db.models.query import QuerySet
from typing import Any
import random
from django_topics.models.pool import TopicPool

Expand All @@ -14,10 +16,10 @@ def sample_topic_slugs(self, order, pool: str = None, limit=10) -> list[str]:
else:
raise Exception("Invalid order: '{}'".format(order))

def get_pools_by_topic_slug(self, topic_slug: str) -> list[str]:
def get_pools_by_topic_slug(self, topic_slug: str) -> QuerySet['Topic', Any]:
return self.filter(slug=topic_slug).values_list("pools__name", flat=True)

def get_topic_slugs_by_pool(self, pool: str) -> list[str]:
def get_topic_slugs_by_pool(self, pool: str) -> QuerySet['Topic', Any]:
return self.filter(pools__name=pool).values_list("slug", flat=True)


Expand Down

0 comments on commit 7d40f2c

Please sign in to comment.