Пример #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']))