Keywords Field in Django Model

落花浮王杯 提交于 2020-06-10 07:21:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!