# -*- coding: utf-8 -*-
from base import *
-import logging
import re
from tag import Tag
@classmethod
def _generate_cache_key(cls, key, group="node"):
return super(Node, cls)._generate_cache_key(key, group)
-
+
@classmethod
def get_type(cls):
return cls.__name__.lower()
if not self.nis.deleted:
tag.add_to_usage_count(1)
+ tag.save()
if not self.nis.deleted:
for name in tag_changes['removed']:
try:
tag = Tag.objects.get(name=name)
tag.add_to_usage_count(-1)
- except Tag.DoesNotExist:
+ tag.save()
+ except:
pass
return True
if action:
for tag in self.tags.all():
tag.add_to_usage_count(-1)
+ tag.save()
else:
for tag in Tag.objects.filter(name__in=self.tagname_list()):
tag.add_to_usage_count(1)
+ tag.save()
def delete(self, *args, **kwargs):
for tag in self.tags.all():
tag.add_to_usage_count(-1)
+ tag.save()
self.active_revision = None
self.save()