API change. Removed managers for Attributes and Tags - these are instead incoorporated into the TypedObjectManager which all Typeclassed object handlers inherit from. This concludes the refactor started in #529. This means that access to Attributes/Permissions/Aliases and Tags/nicks are done directly through e.g. ObjectDB.objects.get_by_tag() (or ev.managers.objects.get_by_tag) rather than using Tag.get_obj_with_tag and specifying the model type manually. The create_tag() method was also moved into the TypedObjectManager as part of removing the Tagmanager. As part of this change, Tag and Attribute was also removed from the ev interface.
This commit is contained in:
parent
08b18524fd
commit
5b42b31240
6 changed files with 123 additions and 216 deletions
|
|
@ -40,7 +40,6 @@ _PlayerDB = None
|
|||
_to_object = None
|
||||
_ChannelDB = None
|
||||
_channelhandler = None
|
||||
_Tag = None
|
||||
|
||||
|
||||
# limit symbol import from API
|
||||
|
|
@ -450,18 +449,6 @@ def create_channel(key, aliases=None, desc=None,
|
|||
channel = create_channel
|
||||
|
||||
|
||||
def create_tag(self, key=None, category=None, data=None):
|
||||
"""
|
||||
Create a tag. This makes sure to create case-insensitive tags.
|
||||
Note that if the exact same tag configuration (key+category)
|
||||
exists, it will be re-used. A data keyword will overwrite existing
|
||||
data on a tag (it is not part of what makes the tag unique).
|
||||
"""
|
||||
global _Tag
|
||||
if not _Tag:
|
||||
from src.typeclasses.models import Tag as _Tag
|
||||
return _Tag.objects.create_tag(key=key, category=category, data=data)
|
||||
|
||||
|
||||
#
|
||||
# Player creation methods
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue