mirror of https://github.com/snachodog/mybuddy.git
parent
b2c228fac9
commit
9d3c32fec1
|
@ -44,9 +44,10 @@ class Command(BaseCommand):
|
||||||
children = int(kwargs["children"]) or 1
|
children = int(kwargs["children"]) or 1
|
||||||
days = int(kwargs["days"]) or 31
|
days = int(kwargs["days"]) or 31
|
||||||
|
|
||||||
for word in self.faker.words(10, unique=True):
|
for i in range(0, 10):
|
||||||
|
text = self.faker.password(randint(4, 10))
|
||||||
try:
|
try:
|
||||||
tag = models.Tag.objects.create(name=word)
|
tag = models.Tag.objects.create(name=text)
|
||||||
tag.save()
|
tag.save()
|
||||||
self.tags.append(tag)
|
self.tags.append(tag)
|
||||||
except IntegrityError:
|
except IntegrityError:
|
||||||
|
|
|
@ -9,8 +9,7 @@ from core import models
|
||||||
class TagFilter(django_filters.FilterSet):
|
class TagFilter(django_filters.FilterSet):
|
||||||
tag = django_filters.ModelChoiceFilter(
|
tag = django_filters.ModelChoiceFilter(
|
||||||
label=_("Tag"),
|
label=_("Tag"),
|
||||||
field_name="tags__slug",
|
field_name="tags__name",
|
||||||
to_field_name="slug",
|
|
||||||
distinct=True,
|
distinct=True,
|
||||||
queryset=models.Tag.objects.all().order_by("name"),
|
queryset=models.Tag.objects.all().order_by("name"),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue