# Path: dockit/forms/forms.py
# class DocumentForm(BaseDocumentForm):
#     """ The document form object """
#     __metaclass__ = DocumentFormMetaClass


from django.core.exceptions import ImproperlyConfigured
from django.views.generic import edit as editview
from detail import SingleObjectMixin, SingleObjectTemplateResponseMixin, BaseDetailView
from dockit.forms import DocumentForm



class DocumentFormMixin(editview.FormMixin, SingleObjectMixin):
    def get_form_class(self):
        """
        Returns the form class to use in this view
        """
        if self.form_class:
            return self.form_class
        else:
            if self.document is not None:
                # If a document has been explicitly provided, use it
                document = self.document
            elif hasattr(self, 'object') and self.object is not None:
                # If this view is operating on a single object, use
                # the class of that object
                document = self.object.__class__
            else:
                # Try to get a queryset and extract the document class
                # from that
                document = self.get_queryset().document
            #fields = fields_for_document(document)

# Path: dockit/forms/forms.py
# class DocumentForm(BaseDocumentForm):
#     """ The document form object """
#     __metaclass__ = DocumentFormMetaClass


# Path: dockit/views/edit.py
from django.core.exceptions import ImproperlyConfigured
from django.views.generic import edit as editview
from detail import SingleObjectMixin, SingleObjectTemplateResponseMixin, BaseDetailView
from dockit.forms import DocumentForm




class DocumentFormMixin(editview.FormMixin, SingleObjectMixin):
    def get_form_class(self):
        """
        Returns the form class to use in this view
        """
        if self.form_class:
            return self.form_class
        else:
            if self.document is not None:
                # If a document has been explicitly provided, use it
                document = self.document
            elif hasattr(self, 'object') and self.object is not None:
                # If this view is operating on a single object, use
                # the class of that object
                document = self.object.__class__
            else:
                # Try to get a queryset and extract the document class
                # from that
                document = self.get_queryset().document
            #fields = fields_for_document(document)

            class CustomDocumentForm(DocumentForm):