# Path: textplusstuff/exceptions.py
# class InvalidRenderOption(Exception):
#     pass
# 
# class NotRegistered(Exception):
#     pass
# 
# class MissingRendition(Exception):
#     pass
# 
# Path: textplusstuff/registry.py
# class Rendition(object):
# class Stuff(object):
# class ModelStuff(Stuff):
#         class ListSerializer(ModelSerializer):
#             class Meta:
# class StuffRegistry(object):
#         class ListStuffGroups(TextPlusStuffAPIViewMixIn, APIView):
#     def __init__(self, short_name, verbose_name, description,
#                  path_to_template, rendition_type='block'):
#     def get_context_data(self, **context):
#     def render_as_html(self, context):
#     def __init__(self, model):
#     def _verify_rendition(self, rendition):
#     def _verify_rendition_list_uniqueness(self, rendition_list):
#     def _verify_and_build_initial_rendition_dict(self):
#     def register_non_core_rendition(self, rendition):
#     def get_list_serializer(self):
#     def list_view(self):
#     def detail_view(self):
#     def get_url_name_key(self):
#     def get_urls(self):
#     def __init__(self, name='stuff_registry'):
#     def verify_stuff_cls(self, stuff_cls):
#     def verify_groups(self, groups, stuff_cls):
#     def add_modelstuff(self, model, stuff_cls, groups=[]):
#     def add_noncore_modelstuff_rendition(self, model, rendition):
#     def remove_modelstuff(self, model):
#     def index(self):
#             def prepare_stuffgroups(self):
#             def get_generated_stuffgroups(self):
#             def get(self, request, format=None):
#     def get_urls(self):
#     def urls(self):
# def get_modelstuff_renditions(model_instance):


from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import force_str
from bs4 import BeautifulSoup
from markdown2 import Markdown
from ..exceptions import InvalidRenderOption, NotRegistered, MissingRendition
from ..registry import stuff_registry
        """
        stuff_config = self.get_stuff_config()
        try:
            instance = stuff_config.queryset.get(
                pk=self.node_mapping.get('object_id')
            )
        except stuff_config.queryset.model.DoesNotExist:
            raise stuff_config.queryset.model.DoesNotExist(
                "The model instance associated with this token (uid: {}): "
                "model: {}, pk: {} could not be retrieved and, therefore, "
                "could not be rendered.".format(
                    self.payload,
                    stuff_config.queryset.model,
                    self.node_mapping.get('object_id')
                )
            )
        else:
            return instance

    def get_rendition(self):
        """
        Returns the rendition associated with this Node.
        """
        stuff_config = self.get_stuff_config()
        try:
            rendition = stuff_config._renditions[
                self.node_mapping.get('rendition_key')
            ]
        except KeyError:
            model_cls = self.get_model_class()

# Path: textplusstuff/exceptions.py
# class InvalidRenderOption(Exception):
#     pass
# 
# class NotRegistered(Exception):
#     pass
# 
# class MissingRendition(Exception):
#     pass
# 
# Path: textplusstuff/registry.py
# class Rendition(object):
# class Stuff(object):
# class ModelStuff(Stuff):
#         class ListSerializer(ModelSerializer):
#             class Meta:
# class StuffRegistry(object):
#         class ListStuffGroups(TextPlusStuffAPIViewMixIn, APIView):
#     def __init__(self, short_name, verbose_name, description,
#                  path_to_template, rendition_type='block'):
#     def get_context_data(self, **context):
#     def render_as_html(self, context):
#     def __init__(self, model):
#     def _verify_rendition(self, rendition):
#     def _verify_rendition_list_uniqueness(self, rendition_list):
#     def _verify_and_build_initial_rendition_dict(self):
#     def register_non_core_rendition(self, rendition):
#     def get_list_serializer(self):
#     def list_view(self):
#     def detail_view(self):
#     def get_url_name_key(self):
#     def get_urls(self):
#     def __init__(self, name='stuff_registry'):
#     def verify_stuff_cls(self, stuff_cls):
#     def verify_groups(self, groups, stuff_cls):
#     def add_modelstuff(self, model, stuff_cls, groups=[]):
#     def add_noncore_modelstuff_rendition(self, model, rendition):
#     def remove_modelstuff(self, model):
#     def index(self):
#             def prepare_stuffgroups(self):
#             def get_generated_stuffgroups(self):
#             def get(self, request, format=None):
#     def get_urls(self):
#     def urls(self):
# def get_modelstuff_renditions(model_instance):


# Path: textplusstuff/parser/nodes.py
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import force_str
from bs4 import BeautifulSoup
from markdown2 import Markdown
from ..exceptions import InvalidRenderOption, NotRegistered, MissingRendition
from ..registry import stuff_registry

        """
        stuff_config = self.get_stuff_config()
        try:
            instance = stuff_config.queryset.get(
                pk=self.node_mapping.get('object_id')
            )
        except stuff_config.queryset.model.DoesNotExist:
            raise stuff_config.queryset.model.DoesNotExist(
                "The model instance associated with this token (uid: {}): "
                "model: {}, pk: {} could not be retrieved and, therefore, "
                "could not be rendered.".format(
                    self.payload,
                    stuff_config.queryset.model,
                    self.node_mapping.get('object_id')
                )
            )
        else:
            return instance

    def get_rendition(self):
        """
        Returns the rendition associated with this Node.
        """
        stuff_config = self.get_stuff_config()
        try:
            rendition = stuff_config._renditions[
                self.node_mapping.get('rendition_key')
            ]
        except KeyError:
            model_cls = self.get_model_class()

            raise MissingRendition(