MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / validate

Method validate

cassandra/cqlengine/models.py:599–608  ·  view source on GitHub ↗

Cleans and validates the field values

(self)

Source from the content-addressed store, hash-verified

597 self._values[name].value = value # internal assignement, skip the main setter
598
599 def validate(self):
600 """
601 Cleans and validates the field values
602 """
603 for name, col in self._columns.items():
604 v = getattr(self, name)
605 if v is None and not self._values[name].explicit and col.has_default:
606 v = col.get_default()
607 val = col.validate(v)
608 self._set_column_value(name, val)
609
610 # Let an instance be used like a dict of its columns keys/values
611 def __iter__(self):

Callers 2

saveMethod · 0.95
updateMethod · 0.95

Calls 3

_set_column_valueMethod · 0.95
get_defaultMethod · 0.80
itemsMethod · 0.45

Tested by

no test coverage detected