+ if remove_duplicate:
+ b.delete()
+
+ print "Searching for empty groups and orphaned buttons:"
+ for g in ButtonGroup.objects.all():
+ if len(g.button_set.all()) == 0:
+ print "Empty group: '%s'" % g.slug
+
+ for b in Button.objects.all():
+ if len(b.group.all()) == 0:
+ print "orphan: '%s'" % b.slug