简体   繁体   English

在Django 1.1中用于标记的内容

[英]What to use for tagging in Django 1.1

Unless I'm missing something, it seems django-tagging (0.3) doesnt work on Django 1.1.x. 除非我缺少任何东西,否则django-tagging(0.3)似乎在Django 1.1.x上不起作用。 I was having issues then search around and it seems to be the general concensious. 我遇到了问题然后四处寻找,这似乎是普遍的共识。

What are other people using? 别人在用什么? Just in case here is all I'm doing. 以防万一,这就是我在做什么。

class Article(models.Model):
    title = models.CharField(max_length=200)
    tags = TagField()

tagging.register(Article)

class ArticleAdmin(admin.ModelAdmin)
    fieldsets = (
        (None, { 'fields': ('title', 'tags',)  }),

admin.site.register(Article, ArticleAdmin)

I have a script that added a bunch of tags and they are in the DB without issue. 我有一个脚本,添加了很多标签,它们在数据库中没有问题。 But if I visit the admin, I get 但是如果我访问管理员,我会得到

Tags: [<Tag: []>] 标签: [<Tag: []>]

I don't need advanced features. 我不需要高级功能。 I just want to have an admin field where I can type in tags, to some related searches based on tags not a whole lot else. 我只想有一个管理字段,我可以在其中键入标签,以基于标签的一些相关搜索,而不是很多其他内容。 Thats about it. 就是这样。

Thanks 谢谢

I coded up this pattern recently using django-batch-select , take a look. 我最近使用django-batch-select对此模式进行了编码,看看吧。 Obviously you'll still need to code up the admin side of things but it shouldn't be too difficult. 显然,您仍然需要在管理方面进行编码,但这并不难。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM