mirror of
https://github.com/evennia/evennia.git
synced 2026-03-24 00:36:30 +01:00
Added at_set hook for Attributes. This is a first step towards OOB definition.
This commit is contained in:
parent
d42949b324
commit
1643427fa3
1 changed files with 8 additions and 0 deletions
|
|
@ -429,6 +429,8 @@ class Attribute(SharedMemoryModel):
|
|||
self.no_cache = False
|
||||
self.db_value = to_unicode(_PDUMPS(to_str(new_value)))
|
||||
self.save()
|
||||
# call attribute hook
|
||||
self.at_set(new_value)
|
||||
|
||||
#@value.deleter
|
||||
def __value_del(self):
|
||||
|
|
@ -619,6 +621,12 @@ class Attribute(SharedMemoryModel):
|
|||
"""
|
||||
return self.locks.check(accessing_obj, access_type=access_type, default=default)
|
||||
|
||||
def at_set(self, new_value):
|
||||
"""
|
||||
Hook method called when the attribute changes value.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
#------------------------------------------------------------
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue