'Set a value in the document object, update the timestamp and update the database.
WARNING: This method does not trigger controller validations and should
be used very carefully.
:param fieldname: fieldname of the property to be updated, or a {"field":"value"} dictionary
:param value: value of the property to be updated
:param update_modified: default True. updates the `modified` and `modified_by` properties'

def db_set(self, fieldname, value=None, update_modified=True):

    if isinstance(fieldname, dict):
        self.update(fieldname)
    else:
        self.set(fieldname, value)
    if (update_modified and ((self.doctype, self.name) not in frappe.flags.currently_saving)):
        self.set(u'modified', now())
        self.set(u'modified_by', frappe.session.user)
    self.run_method(u'before_change')
    frappe.db.set_value(self.doctype, self.name, fieldname, value, self.modified, self.modified_by, update_modified=update_modified)
    self.run_method(u'on_change')
