Closes #165: get_internal_type returns TextField

This commit is contained in:
adi 2019-12-26 21:06:01 +01:00
parent 4b34e6ce71
commit 21cae7f261

View file

@ -6,11 +6,11 @@ from .fields import MarkdownxFormField
class MarkdownxField(models.TextField):
"""
Custom Django field for Markdown text.
Parameters are identical to those of the ordinary Django **TextField** parameters for the model
fields. For consistency therefore, the descriptions have been borrowed from Django's official
documentations (with minor modifications).
:param verbose_name: A human-readable name for the field. If the verbose name isn't given,
Django will automatically create it using the field's attribute name,
converting underscores to spaces.
@ -38,11 +38,14 @@ class MarkdownxField(models.TextField):
:type error_messages: dict
:param kwargs: Other ``django.db.models.field`` parameters. See Django documentations_ for additional
information.
.. _documentations: https://docs.djangoproject.com/en/1.10/ref/models/fields/#error-messages
.. _validators: https://docs.djangoproject.com/en/DEV_CONTENTS_XML/ref/validators/
"""
def get_internal_type(self):
return 'MarkdownxField (TextField)'
def formfield(self, **kwargs):
"""
Customising the ``form_class``.