问题
I'm beginner in Django. In my model I have a Field named keywords that I want to store keywords in it (separated by comma).
A user may enter a compound keyword "learn Django" or "Django model-Fields", and also I want to have the possibility to set a max_length for every keyword. And a max ? of keywords!
How can I do this please ?
回答1:
You can add this feature to any model using django taggit or a similar app. Using an existing app also means you don't have to repeat the work they've already done, such as producing a 'similar items' queryset.
来源:https://stackoverflow.com/questions/23132272/keywords-field-in-django-model