pytoolbox.django.models.utils module

Some utilities related to the model layer.

pytoolbox.django.models.utils.get_base_model(cls_or_instance)[source]
pytoolbox.django.models.utils.get_content_type_dict(instance)[source]

Return a dictionary with the serialized content type and private key of given instance.

pytoolbox.django.models.utils.get_instance(app_label, model, pk)[source]

Return an instance given its app_label, model name and private key.

pytoolbox.django.models.utils.try_get_field(instance, field_name)[source]