From f77593994ebd6e926db0268e2611b42de024caa5 Mon Sep 17 00:00:00 2001 From: ChrisLR Date: Thu, 31 Mar 2022 12:00:47 -0400 Subject: [PATCH] Changed DBField and NDBField delimiters from __ to :: --- evennia/contrib/base_systems/components/README.md | 2 +- evennia/contrib/base_systems/components/dbfield.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/evennia/contrib/base_systems/components/README.md b/evennia/contrib/base_systems/components/README.md index fc594aa036..8f30b03630 100644 --- a/evennia/contrib/base_systems/components/README.md +++ b/evennia/contrib/base_systems/components/README.md @@ -39,7 +39,7 @@ class Health(Component): Components may define DBFields or NDBFields at the class level. DBField will store its values in the host's DB with a prefixed key. NDBField will store its values in the host's NDB and will not persist. -The key used will be 'component_name__field_name'. +The key used will be 'component_name::field_name'. They use AttributeProperty under the hood. Example: diff --git a/evennia/contrib/base_systems/components/dbfield.py b/evennia/contrib/base_systems/components/dbfield.py index 7e2d16edee..9adbf8197f 100644 --- a/evennia/contrib/base_systems/components/dbfield.py +++ b/evennia/contrib/base_systems/components/dbfield.py @@ -21,7 +21,7 @@ class DBField(AttributeProperty): owner (object): The component classF on which this is set name (str): The name that was used to set the DBField. """ - key = f"{owner.name}__{name}" + key = f"{owner.name}::{name}" self._key = key db_fields = getattr(owner, "_db_fields", None) if db_fields is None: @@ -45,7 +45,7 @@ class NDBField(NAttributeProperty): owner (object): The component class on which this is set name (str): The name that was used to set the DBField. """ - key = f"{owner.name}__{name}" + key = f"{owner.name}::{name}" self._key = key ndb_fields = getattr(owner, "_ndb_fields", None) if ndb_fields is None: