Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz committed Aug 30, 2022
1 parent e49868f commit 63a037f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/django_mysql/models/fields/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from django.db.models import CharField, Field, IntegerField, Lookup, Model, TextField
from django.db.models.expressions import BaseExpression
from django.db.models.sql.compiler import SQLCompiler
from django.forms import Field as FormField
from django.utils.translation import gettext_lazy as _

from django_mysql.forms import SimpleListField
Expand Down Expand Up @@ -66,7 +65,7 @@ def check(self, **kwargs: Any) -> list[checks.CheckMessage]:
return errors

@property
def description(self) -> Any:
def description(self) -> str:
return _("List of %(base_description)s") % {
"base_description": self.base_field.description
}
Expand Down Expand Up @@ -146,7 +145,7 @@ def value_to_string(self, obj: Any) -> str:
vals = self.value_from_object(obj)
return self.get_prep_value(vals)

def formfield(self, **kwargs: Any) -> FormField:
def formfield(self, **kwargs: Any) -> Any:
defaults = {
"form_class": SimpleListField,
"base_field": self.base_field.formfield(),
Expand Down
2 changes: 1 addition & 1 deletion src/django_mysql/models/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ def approx_count(queryset: models.QuerySet) -> int:
)
# N.B. when we support more complex QuerySets they should be estimated
# with 'EXPLAIN SELECT'
approx_count = cursor.fetchone()[0]
approx_count: int = cursor.fetchone()[0]
return approx_count


Expand Down

0 comments on commit 63a037f

Please sign in to comment.