- changed_at__lt=until).iterator():
- # only serve non-empty tags
- if tag.book_count:
- tag_d = cls.tag_dict(tag, fields)
- updated.append(tag_d)
- elif tag.created_at < since:
- deleted.append(tag.id)
+ changed_at__lt=until
+ ).exclude(items=None).iterator():
+ tag_d = cls.tag_dict(tag, fields)
+ updated.append(tag_d)
+ for tag in Tag.objects.filter(category__in=categories,
+ created_at__lt=since,
+ changed_at__gte=since,
+ changed_at__lt=until,
+ items=None).iterator():
+ deleted.append(tag.id)