2

How can I know if a new tag is created for a model? Looks like the django-tagging API does not provide such method. I'm new to both Django and django-tagging app and would like to hear your advice.

Update: what I'm trying to acomplish is to add more properties to tags. I think to have another model TagProperties linked to Tag model. And every time the Tag is save I save the TagProperies as well.

grigy
  • 6,696
  • 12
  • 49
  • 76

1 Answers1

2

One way would be to use django signals. You could connect a post_save signal to the Tag model and handle that for when a new instance is created.

ars
  • 120,335
  • 23
  • 147
  • 134
  • ars, thanks for the answer. I'll try that out. BTW, I have updated the question and you may see another solution. – grigy Aug 26 '10 at 08:34
  • This should be fine: you can save your TagProperties object in the `post_save` handler. – ars Aug 26 '10 at 21:52