示例#1
0
 def test_alphanum_key(self):
     assert alphanum_key('z23a1b0') == ['z', 23, 'a', 1, 'b', 0, '']
示例#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']))
示例#3
0
 def test_alphanum_key(self):
     assert alphanum_key('z23a1b0') == ['z', 23, 'a', 1, 'b', 0, '']
示例#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']))