cdh.core.utils.general module

cdh.core.utils.general.is_empty(value)[source]

Checks if value is filled out (!= None). For lists and strings, also check if the value is not empty.

cdh.core.utils.general.set_model_field_value(model, field, value)[source]

Sets a ForeignKey field value on a model, accepting both model-instance and (int) pk values. :param model: The model instance to set the value on :param field: The name of the field to set :param value: Either a model instance or a PK value for a model :return:

cdh.core.utils.general.string_to_bool(s)[source]