如何在Django中使用属性标记? [英] How make tags with properties in Django?

查看:106
本文介绍了如何在Django中使用属性标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

django-tagging应用程序提供基本的标记功能.我还需要每个标签都具有属性(类别,描述等),基本上是一个相关的表.您的建议是什么,我应该尝试使用django-tagging还是从头开始实施"my tagging"?

The django-tagging app provides basic tagging functionality. I need each tag also to have properties (category, description, etc.), basically a related table. What's your recommendation, should I try to get this with django-tagging or implement "my tagging" from scratch?

推荐答案

创建一个模型来保存标签元数据.

Create a model to hold your tag metadata.

使用标签实例,您可以查找模型实例以了解类别,描述等.如果发现标签元数据实例可以使事情变得更容易,则甚至可以使用标签对其进行标签.

With a tag instance you can look up the model instance to learn the category, description, etc. You could even tag the metadata instance with the tag if you find that makes things easier.

这篇关于如何在Django中使用属性标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆