Esempio n. 1
0
 def test_alphanum_key(self):
     assert alphanum_key('z23a1b0') == ['z', 23, 'a', 1, 'b', 0, '']
Esempio n. 2
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']))
Esempio n. 3
0
 def test_alphanum_key(self):
     assert alphanum_key('z23a1b0') == ['z', 23, 'a', 1, 'b', 0, '']
Esempio n. 4
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']))