def test_alphanum_key(self): assert alphanum_key('z23a1b0') == ['z', 23, 'a', 1, 'b', 0, '']
def inventory(cls, types=[]): return sorted([ f.__json__() for f in cls.query.all() if not types or (types and f.type in types) ], key=lambda f: alphanum_key(f['name']))