ui tweaks, admin form

This commit is contained in:
Jakub Senderák
2020-04-22 14:16:49 +02:00
parent d657dedf5f
commit d12f5c093c
6 changed files with 238 additions and 124 deletions
+12
View File
@@ -69,6 +69,18 @@ class Card():
def __repr__(self):
return '<Card {}_{}>'.format(self.color.name, self.value.name)
@staticmethod
def sort_card_list(input_card_set: []) -> []:
hearts = [c for c in input_card_set if c.color == Card_colors['HEARTS']]
leaves = [c for c in input_card_set if c.color == Card_colors['LEAVES']]
acorns = [c for c in input_card_set if c.color == Card_colors['ACORNS']]
bells = [c for c in input_card_set if c.color == Card_colors['BELLS']]
hearts.sort(key=lambda a : a.value)
leaves.sort(key=lambda a : a.value)
acorns.sort(key=lambda a : a.value)
bells.sort(key=lambda a : a.value)
return hearts + leaves + acorns + bells
class JSONEncoder(JSONEncoder):
def default(self, obj):
if isinstance(obj, Card):