From 9684629b6cc541a93f7be240719bb1f37e8306aa Mon Sep 17 00:00:00 2001 From: Pavan Verma Date: Fri, 22 Jul 2016 12:09:48 +0530 Subject: [PATCH] Fixed issue: https://github.com/wlanslovenija/django-tastypie-mongoengine/issues/95 --- tastypie_mongoengine/resources.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tastypie_mongoengine/resources.py b/tastypie_mongoengine/resources.py index 182e187..51fb8b2 100644 --- a/tastypie_mongoengine/resources.py +++ b/tastypie_mongoengine/resources.py @@ -722,9 +722,11 @@ def get_fields(cls, fields=None, excludes=None): 'attribute': name, 'unique': f.unique or primary_key, 'null': not f.required and not primary_key, - 'help_text': f.help_text, } + if hasattr(f, 'help_text'): + kwargs['help_text'] = f.help_text + # If field is not required, it does not matter if set default value, # so we do if not f.required: