Version 6.x.x Source

Class BaseDocument

Inherits from __builtin__.object

__init__ (self, d)

No docs


_extract_images_from_text_editor (self)

No docs


_fix_numeric_types (self)

No docs


_get_missing_mandatory_fields (self)

Get mandatory fields that do not have any values


_init_child (self, value, key)

No docs


_validate_constants (self)

No docs


_validate_length (self)

No docs


_validate_selects (self)

No docs


_validate_update_after_submit (self)

No docs


append (self, key, value=None)

No docs


as_dict (self, no_nulls=False, no_default_fields=False)

No docs


as_json (self)

No docs


cast (self, val, df)

No docs


db_insert (self)

INSERT the document (with valid columns) in the database.


db_set (self, fieldname, value, update_modified=True)

No docs


db_update (self)

No docs


delete_key (self, key)

No docs


extend (self, key, value)

No docs


get (self, key=None, filters=None, limit=None, default=None)

No docs


get_db_value (self, key)

No docs


get_formatted (self, fieldname, doc=None, currency=None, absolute_value=False)

No docs


get_invalid_links (self, is_submittable=False)

No docs


get_parentfield_of_doctype (self, doctype)

No docs


get_table_field_doctype (self, fieldname)

No docs


get_valid_columns (self)

No docs


get_valid_dict (self)

No docs


get_value (self, fieldname)

No docs


getone (self, key, filters=None)

No docs


in_format_data (self, fieldname)

Returns True if shown via Print Format::format_data property. Called from within standard print format.


init_valid_columns (self)

No docs


is_new (self)

No docs


is_print_hide (self, fieldname, df=None, for_print=True)

Returns true if fieldname is to be hidden for print.

Print Hide can be set via the Print Format Builder or in the controller as a list of hidden fields. Example

class MyDoc(Document):
    def __setup__(self):
        self.print_hide = ["field1", "field2"]

Parameters:


precision (self, fieldname, parentfield=None)

Returns float precision for a particular field (or get global default).

Parameters:


remove (self, doc)

No docs


reset_values_if_no_permlevel_access (self, has_access_to, high_permlevel_fields)

If the user does not have permissions at permlevel > 0, then reset the values to original / default


set (self, key, value, as_value=False)

No docs


show_unique_validation_message (self, e)

No docs


update (self, d)

No docs


update_if_missing (self, d)

No docs



frappe.model.base_document._filter (data, filters, limit=None)

pass filters as: {"key": "val", "key": ["!=", "val"], "key": ["in", "val"], "key": ["not in", "val"], "key": "^val", "key" : True (exists), "key": False (does not exist) }


frappe.model.base_document.get_controller (doctype)

Returns the class object of the given DocType. For custom type, returns frappe.model.document.Document.

Parameters: