def init_model(self, model, value):
        """Init model with field.

        :param DomainModel model:
        :param object value:
        """
        if value is None and self.default is not None:
            value = self.default() if callable(self.default) else self.default

        self.set_value(model, value)
def init_model ( self , model , value ) : if value is None and self . default is not None : value = self . default ( ) if callable ( self . default ) else self . default self . set_value ( model , value )
Init model with field.

        :param DomainModel model:
        :param object value: