You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
363 B
14 lines
363 B
from django.core.management.base import BaseCommand
|
|
|
|
from blog.models import Tag, Category
|
|
|
|
|
|
# TODO 参数化
|
|
class Command(BaseCommand):
|
|
help = 'build search words'
|
|
|
|
def handle(self, *args, **options):
|
|
datas = set([t.name for t in Tag.objects.all()] +
|
|
[t.name for t in Category.objects.all()])
|
|
print('\n'.join(datas))
|