Debug code: comparing .tags.all() vs tags.get()

This commit is contained in:
Henddher Pedroza 2018-10-06 19:29:32 -05:00
parent a0f113ad52
commit a3b37d60ed

View file

@ -79,7 +79,11 @@ from evennia import DefaultExit
from evennia.commands.default.muxcommand import MuxCommand from evennia.commands.default.muxcommand import MuxCommand
from evennia.utils.utils import inherits_from from evennia.utils.utils import inherits_from
from evennia.utils import search, utils, logger from evennia.utils import search, utils, logger
from evennia.prototypes.spawner import spawn from evennia.prototypes.spawner import (
spawn,
# prototype_from_object,
# prototype_diff
)
# Tag used by puzzles # Tag used by puzzles
_PUZZLES_TAG_CATEGORY = 'puzzles' _PUZZLES_TAG_CATEGORY = 'puzzles'
@ -110,8 +114,12 @@ def proto_def(obj, with_tags=True):
'permissions': obj.permissions.all()[:], 'permissions': obj.permissions.all()[:],
} }
if with_tags: if with_tags:
# import ipdb
# ipdb.set_trace()
_tags = obj.tags.get(return_tagobj=True, return_list=True)
tags = obj.tags.all(return_key_and_category=True) tags = obj.tags.all(return_key_and_category=True)
tags.append((_PUZZLES_TAG_MEMBER, _PUZZLES_TAG_CATEGORY)) tags = [(t[0], t[1], None) for t in tags]
tags.append((_PUZZLES_TAG_MEMBER, _PUZZLES_TAG_CATEGORY, None))
protodef['tags'] = tags protodef['tags'] = tags
return protodef return protodef