'Return tags in the desired creation order.
Tags may include case look-alikes, such as \'Firefox\' and \'firefox\'.
With taggit 0.18.0, setting both at the same time will result in an
IntegrityError.  This returns the tags with the most capital letters
first, so that \'Firefox\' will be prioritized over \'firefox\'.'

def sorted_tags(self, tags):

    tag_sort = sorted([(sum((1 for c in tag if c.islower())), tag) for tag in tags])
    return [tag for (_, tag) in tag_sort]
