'Check whether this is the last item within the parent\'s
components list with these flags
@param flags: dictionary of flags'

def is_last(self, **flags):

    if (not flags):
        return (len(self.following()) == 0)
    if (not all([(getattr(self, f) == flags[f]) for f in flags])):
        return False
    following = self.following()
    if following:
        for item in following:
            if all([(getattr(item, f) == flags[f]) for f in flags]):
                return False
    return True
