ltag = get_ltag(book, orm)
for child in book.children.all():
ltag_descendants(child, ltags + [ltag])
ltag = get_ltag(book, orm)
for child in book.children.all():
ltag_descendants(child, ltags + [ltag])
orm.TagRelation.objects.filter(content_type=book_ct, tag__category='book').delete()
for book in orm.Book.objects.filter(parent=None):
ltag_descendants(book)
orm.TagRelation.objects.filter(content_type=book_ct, tag__category='book').delete()
for book in orm.Book.objects.filter(parent=None):
ltag_descendants(book)
def backwards(self, orm):
""" Delete _tag_counter and make sure books carry own l-tag. """
def backwards(self, orm):
""" Delete _tag_counter and make sure books carry own l-tag. """
orm.TagRelation.objects.filter(content_type=book_ct, tag__category='book').delete()
for book in orm.Book.objects.filter(parent=None):
orm.TagRelation(object_id=book.pk, tag=get_ltag(book, orm), content_type=book_ct).save()
orm.TagRelation.objects.filter(content_type=book_ct, tag__category='book').delete()
for book in orm.Book.objects.filter(parent=None):
orm.TagRelation(object_id=book.pk, tag=get_ltag(book, orm), content_type=book_ct).save()