mirror of
https://github.com/evennia/evennia.git
synced 2026-03-31 21:17:17 +02:00
Created wrappers for creating Tags.
This commit is contained in:
parent
f4c9c18a66
commit
72bdc3b37f
2 changed files with 22 additions and 2 deletions
|
|
@ -40,6 +40,7 @@ _PlayerDB = None
|
|||
_to_object = None
|
||||
_ChannelDB = None
|
||||
_channelhandler = None
|
||||
_Tag = None
|
||||
|
||||
|
||||
# limit symbol import from API
|
||||
|
|
@ -398,6 +399,19 @@ 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