mirror of
https://github.com/evennia/evennia.git
synced 2026-04-02 14:07:16 +02:00
Made the migrations for the new Tags and LiteAttributes.
This commit is contained in:
parent
e178963941
commit
2c17b7b675
9 changed files with 829 additions and 84 deletions
|
|
@ -24,7 +24,7 @@ from src.server.caches import get_field_cache, set_field_cache, del_field_cache
|
|||
from src.server.caches import get_prop_cache, set_prop_cache, del_prop_cache
|
||||
|
||||
from src.typeclasses.typeclass import TypeClass
|
||||
from src.players.models import PlayerNick
|
||||
#from src.players.models import PlayerNick
|
||||
from src.objects.manager import ObjectManager
|
||||
from src.players.models import PlayerDB
|
||||
from src.commands.cmdsethandler import CmdSetHandler
|
||||
|
|
@ -54,55 +54,55 @@ _HERE = _("here")
|
|||
#
|
||||
#------------------------------------------------------------
|
||||
|
||||
class Alias(SharedMemoryModel):
|
||||
"""
|
||||
This model holds a range of alternate names for an object.
|
||||
These are intrinsic properties of the object. The split
|
||||
is so as to allow for effective global searches also by
|
||||
alias.
|
||||
"""
|
||||
db_key = models.CharField('alias', max_length=255, db_index=True)
|
||||
db_obj = models.ForeignKey("ObjectDB", verbose_name='object')
|
||||
|
||||
class Meta:
|
||||
"Define Django meta options"
|
||||
verbose_name = "Object alias"
|
||||
verbose_name_plural = "Object aliases"
|
||||
def __unicode__(self):
|
||||
return u"%s" % self.db_key
|
||||
def __str__(self):
|
||||
return str(self.db_key)
|
||||
|
||||
|
||||
|
||||
#------------------------------------------------------------
|
||||
#class Alias(SharedMemoryModel):
|
||||
# """
|
||||
# This model holds a range of alternate names for an object.
|
||||
# These are intrinsic properties of the object. The split
|
||||
# is so as to allow for effective global searches also by
|
||||
# alias.
|
||||
# """
|
||||
# db_key = models.CharField('alias', max_length=255, db_index=True)
|
||||
# db_obj = models.ForeignKey("ObjectDB", verbose_name='object')
|
||||
#
|
||||
# Object Nicks
|
||||
# class Meta:
|
||||
# "Define Django meta options"
|
||||
# verbose_name = "Object alias"
|
||||
# verbose_name_plural = "Object aliases"
|
||||
# def __unicode__(self):
|
||||
# return u"%s" % self.db_key
|
||||
# def __str__(self):
|
||||
# return str(self.db_key)
|
||||
#
|
||||
#------------------------------------------------------------
|
||||
|
||||
class ObjectNick(TypeNick):
|
||||
"""
|
||||
|
||||
The default nick types used by Evennia are:
|
||||
inputline (default) - match against all input
|
||||
player - match against player searches
|
||||
obj - match against object searches
|
||||
channel - used to store own names for channels
|
||||
"""
|
||||
db_obj = models.ForeignKey("ObjectDB", verbose_name='object')
|
||||
|
||||
class Meta:
|
||||
"Define Django meta options"
|
||||
verbose_name = "Nickname for Objects"
|
||||
verbose_name_plural = "Nicknames for Objects"
|
||||
unique_together = ("db_nick", "db_type", "db_obj")
|
||||
|
||||
class ObjectNickHandler(TypeNickHandler):
|
||||
"""
|
||||
Handles nick access and setting. Accessed through ObjectDB.nicks
|
||||
"""
|
||||
NickClass = ObjectNick
|
||||
#
|
||||
#
|
||||
##------------------------------------------------------------
|
||||
##
|
||||
## Object Nicks
|
||||
##
|
||||
##------------------------------------------------------------
|
||||
#
|
||||
#class ObjectNick(TypeNick):
|
||||
# """
|
||||
#
|
||||
# The default nick types used by Evennia are:
|
||||
# inputline (default) - match against all input
|
||||
# player - match against player searches
|
||||
# obj - match against object searches
|
||||
# channel - used to store own names for channels
|
||||
# """
|
||||
# db_obj = models.ForeignKey("ObjectDB", verbose_name='object')
|
||||
#
|
||||
# class Meta:
|
||||
# "Define Django meta options"
|
||||
# verbose_name = "Nickname for Objects"
|
||||
# verbose_name_plural = "Nicknames for Objects"
|
||||
# unique_together = ("db_nick", "db_type", "db_obj")
|
||||
#
|
||||
#class ObjectNickHandler(TypeNickHandler):
|
||||
# """
|
||||
# Handles nick access and setting. Accessed through ObjectDB.nicks
|
||||
# """
|
||||
# NickClass = ObjectNick
|
||||
|
||||
|
||||
#------------------------------------------------------------
|
||||
|
|
@ -199,7 +199,7 @@ class ObjectDB(TypedObject):
|
|||
_SA(self, "cmdset", CmdSetHandler(self))
|
||||
_GA(self, "cmdset").update(init_mode=True)
|
||||
_SA(self, "scripts", ScriptHandler(self))
|
||||
_SA(self, "nicks", ObjectNickHandler(self))
|
||||
#_SA(self, "nicks", ObjectNickHandler(self))
|
||||
|
||||
# Wrapper properties to easily set database fields. These are
|
||||
# @property decorators that allows to access these fields using
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue