Good night guys.
I have two questions about django-taggit:
The problem is that i didn't had idea about django-taggit, but i need tag my own model, a news model, then, i built a custom keywords model, very simple model, and, for this i have two problems.
1. I have a custom admin for this model, i want to know how many childs each tag, and then i write this:
class KeyWordAdmin(ImportExportModelAdmin, admin.ModelAdmin):
actions = (export_as_excel,)
list_display = ('id','name', 'news_counter', )
list_editable = ('name', )
list_filter = ('name', )
search_fields = ('name', )
def news_counter(self, obj):
return obj.news.all().count() #Imprime en pantalla el numero de noticias del autor
news_counter.short_description = 'Noticias'
news_counter.allow_tags = True
# Register your models here.
admin.site.register(KeyWord, KeyWordAdmin)
Ingresar el código aquí...
As you can see, in news_counter method i get all child of each tag and then put it the admin list.
I think that i only need how can i get the child for each django-taggit's tag and the i can rewrite taggit admin. Can you say me how can i get a num childs of a tag?
2. Well, i have a long table for Keywords model and i wan't replace my custom model for django-taggit, but i don't know how do the migration for my table, can you help me with this?
Thank you very much :D