# 创建用户-标签关联插件

**URL:** https://meta.discourse.org/t/creating-a-user-tag-relation-plugin/235208
**Category:** Development
**Created:** [2022年八月5日 10:02 UTC](https://meta.discourse.org/t/creating-a-user-tag-relation-plugin/235208 "2022-08-05T10:02:14Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![attj](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@attj](https://meta.discourse.org/u/attj)
#### Post date: [2022年八月5日 11:46 UTC](https://meta.discourse.org/t/creating-a-user-tag-relation-plugin/235208/3 "2022-08-05T11:46:27Z")

</div>

感谢您提供的信息。我目前的思路是，应该为标签（如 tag\_description）添加一个名为 attached\_users 的自定义字段。对于上面的例子，tag#1 应该有 attached\_users: [“userOP”, “user1”]。

然后，我应该以某种方式将其添加到序列化器中，并找出如何在帖子中显示它。

在思考这个问题时，我还有另一个想法。如果我使用 discourse assign ([Discourse Assign](https://meta.discourse.org/t/discourse-assign/58044)) 来根据标签将这些用户分配给主题。我已经可以从主题中检索到这些信息，并且我认为显示它会更容易。但是，discourse assign 不提供任何以编程方式添加用户的方法。

---

_[View the full topic](https://meta.discourse.org/t/creating-a-user-tag-relation-plugin/235208)._
