django-标记类似应用程序,用于 django 中的特定条件
我正在制作一个项目,我想在其中构建用户配置文件。在此用户个人资料中,我想提供雇主和技能领域。这两个字段都有多对多的关系。一个用户可以有多个雇主,每个雇主可以有与其链接的不同用户。对于技能来说也是如此。
我想向用户提供一个字段,可以在其中输入用空格分隔的雇主,并提供添加另一个雇主
按钮。这与 django-tagging 应用程序非常相似。
但我不能将 tagfield
放在那里,因为我的标签非常通用并且跨越不同的模型。我正在使用tagging-autocomplete
。我只是希望雇主进入自动完成领域,而不仅仅是任何标签。
这可以使用 ManyToMany
字段来完成,但我还没有找到任何好的教程来展示如何做到这一点。
任何帮助或指导表示赞赏。
I am making a project where I want to build a user profile. In this user profile, I want to provide the field for employers and skills. Both of these fields have many to many relationship. One user can have multiple employers and each employer can have different users linked to it. The same is for skills.
To the user I want to provide a field, where it can enter the employers separated by space, and also provide Add another employer
button. This is very similar to django-tagging
application.
But I cannot put the tagfield
there because my tags are very generic and span across different models. I am using an tagging-autocomplete
on it. And I just want the employers to come in the autocomplete field and not just any tag.
This can be done using ManyToMany
fields but I have not found any good tutorial that shows how I can do that.
Any help or direction is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信,它与 django 标记内部的工作方式不相似,因为您需要的只是一个用于选择用户的小部件。这个小部件应该具有自动完成功能。
查看 Facebook 风格 JQuery 自动完成插件问题的答案。
I belive, it is not similar how django-tagging works inside, because what you need is just a widget to select users. And this widget should have autocomplete.
Take a look at the answers on Facebook style JQuery autocomplete plugin question.