'Central database save operation.
Notes:
Arguments as per Django documentation.
Calls `self.at_<fieldname>_postsave(new)`
(this is a wrapper set by oobhandler:
self._oob_at_<fieldname>_postsave())'

def save(self, *args, **kwargs):

    global _MONITOR_HANDLER
    if (not _MONITOR_HANDLER):
        from evennia.scripts.monitorhandler import MONITOR_HANDLER as _MONITOR_HANDLER
    if _IS_SUBPROCESS:
        global PROC_MODIFIED_COUNT, PROC_MODIFIED_OBJS
        PROC_MODIFIED_COUNT += 1
        PROC_MODIFIED_OBJS[PROC_MODIFIED_COUNT] = self
    if _IS_MAIN_THREAD:
        super(SharedMemoryModel, self).save(*args, **kwargs)
    else:
        def _save_callback(cls, *args, **kwargs):
            super(SharedMemoryModel, cls).save(*args, **kwargs)
        callFromThread(_save_callback, self, *args, **kwargs)
    new = False
    if (('update_fields' in kwargs) and kwargs['update_fields']):
        update_fields = (self._meta.get_field(fieldname) for fieldname in kwargs.get('update_fields'))
    else:
        new = True
        update_fields = self._meta.fields
    for field in update_fields:
        fieldname = field.name
        _MONITOR_HANDLER.at_update(self, fieldname)
        hookname = ('at_%s_postsave' % fieldname)
        if (hasattr(self, hookname) and callable(_GA(self, hookname))):
            _GA(self, hookname)(new)
