Answering my own question. No, there is no ready way to change help_text in 
model.
The proposed solution is almost correct, just the get_form_class() function 
should
be defined both in CreateViiew- and UpdateView-derived classes and be like 
the 
following.

    def get_form_class(self):
        'Make a form from a class'

        model = class_by_name(self.kwargs['fmname'])
        form = model_forms.modelform_factory(model)

        # change help_text for fields in derived class, i.e in ReSt class 
and
        # derived from it
        class_list = [model]
        class_list.extend(model._meta.get_parent_list())
        for mod in class_list:
            opts = mod._meta
            if hasattr(opts, 'help_texts'):
                for key, value in opts.help_texts.iteritems():
                    form.base_fields[key].help_text = value
                return form

        return form

The stuff added for Meta help_texts to work is between empty lines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b33a134f-b519-4fad-80a2-da4e8185794f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to