File: content_types.py

package info (click to toggle)
python-model-bakery 1.20.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 532 kB
  • sloc: python: 4,298; sh: 149; makefile: 21
file content (14 lines) | stat: -rw-r--r-- 395 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from django.apps import apps

BAKER_CONTENTTYPES = apps.is_installed("django.contrib.contenttypes")

default_contenttypes_mapping = {}

__all__ = ["BAKER_CONTENTTYPES", "default_contenttypes_mapping"]

if BAKER_CONTENTTYPES:
    from django.contrib.contenttypes.models import ContentType

    from . import random_gen

    default_contenttypes_mapping[ContentType] = random_gen.gen_content_type