jamesturk/django-markupfield — pull request #15 by Markush2010 (2013-08-06 01:59:36+00:00)
Title: Introduce a dedicated title for markup choices in the HTML widget

The basic enhancement introduced by this patch are titled markup choices. As of now, the DEFAULT_MARKUP_TYPES holds a list of 2-tuples (name/key/identifier, callable). Since there are situations where one does not want to set a human readable string as identifier (which then occurs as a selection option in the rendered widget) this commit changes the 2-tuple into a 3-tuple by adding a 'title' as 3rd element. The way the titles are extracted from the tuples, this change should be fully backwards compatible: if a tuple in the list passed to the MarkupField's markup_choices argument is a 2-tuple, the key/identifier is used, otherwise the 3rd item of the tuple.