mirror of
https://github.com/evennia/evennia.git
synced 2026-03-27 10:16:32 +01:00
Changed how lazy-loading of handlers work, using a werkzeug recipe. Much more efficient now.
This commit is contained in:
parent
680e603c4d
commit
e6950aadf2
10 changed files with 125 additions and 144 deletions
|
|
@ -27,9 +27,9 @@ Common examples of uses of Scripts:
|
|||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from src.typeclasses.models import TypedObject, TagHandler, AttributeHandler
|
||||
from src.typeclasses.models import TypedObject
|
||||
from src.scripts.manager import ScriptManager
|
||||
from src.utils.utils import dbref, to_str, LazyLoadHandler
|
||||
from src.utils.utils import dbref, to_str
|
||||
|
||||
__all__ = ("ScriptDB",)
|
||||
_GA = object.__getattribute__
|
||||
|
|
@ -108,13 +108,6 @@ class ScriptDB(TypedObject):
|
|||
"Define Django meta options"
|
||||
verbose_name = "Script"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(ScriptDB, self).__init__(*args, **kwargs)
|
||||
_SA(self, "attributes", LazyLoadHandler(self, "attributes", AttributeHandler))
|
||||
_SA(self, "tags", LazyLoadHandler(self, "tags", TagHandler))
|
||||
#_SA(self, "aliases", AliasHandler(self))
|
||||
|
||||
|
||||
#
|
||||
#
|
||||
# ScriptDB class properties
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue