Opened 16 years ago

Closed 12 years ago

#10317 closed New feature (wontfix)

New Feature: django.contrib.markup.fields.MarkupField

Reported by: James Turk Owned by: James Turk
Component: contrib.markup Version: dev
Severity: Normal Keywords: markup forms
Cc: Carl Meyer Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

I recently published a snippet of something I've wanted in Django for a long time, a MarkupField that handles conversion to HTML on save and an accessor that calls mark_safe.

My implementation is at http://www.djangosnippets.org/snippets/1332/ (Credit where credit is due, I also borrowed the method of detecting which markup libraries are installed from a slightly less featured version http://www.djangosnippets.org/snippets/1169/)

Jacob commented on Twitter that he'd like to see this as well and to submit a ticket.

I'll put together the appropriate fields.py / documentation / tests and should have a candidate patch up soon.

Attachments (1)

markupfield-with-docs.diff (9.3 KB ) - added by James Turk 16 years ago.
markupfield implementation and markup docs changes (now with extra options)

Download all attachments as: .zip

Change History (16)

comment:1 by James Turk, 16 years ago

comment:2 by dc, 16 years ago

I think it must be possible to use any custom markup with this field. Maybe not hardcode markup checks but accept markup func as arg for example?

comment:3 by Alex Gaynor, 16 years ago

One thing I don't like about that implementation is the need to have several attributes on the model, just having a complex obj that stored all of them on 1 attr would be preferable I think.

in reply to:  3 comment:4 by James Turk, 16 years ago

dc & Alex: I've replied to your critiques and opened up discussion on django-developers: http://groups.google.com/group/django-developers/browse_thread/thread/c9124d565c17f972

by James Turk, 16 years ago

Attachment: markupfield-with-docs.diff added

markupfield implementation and markup docs changes (now with extra options)

comment:5 by anonymous, 16 years ago

Has patch: set
Needs tests: set

comment:6 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:7 by Jacob, 16 years ago

Triage Stage: UnreviewedDesign decision needed

comment:8 by Carl Meyer, 16 years ago

Cc: Carl Meyer added

comment:9 by James Turk, 15 years ago

I am now maintaining django-markupfield in a github repository at http://github.com/jamesturk/django-markupfield/ it is not the exact version debated on the list as I personally did not find that useful (though I do see how this version is too special of a case to fit into django core)

Should the design decision on this come down in favor of something akin to what I am now maintaining externally I would be more than happy to do the integration necessary to produce a patch that moves MarkupField into django.contrib.markup

comment:10 by Carl Meyer, 15 years ago

I forgot about this during 1.2 feature proposal, but FWIW I have a fork of James' repo which I've simplified/modified to more or less match the API outlined by James and others in the django-dev thread. I'm using it happily as an external app and don't have any particular itch to see it in core, but if a MarkupField is wanted in core I'd be happy to transform it into a patch and make any needed changes.

comment:11 by Carl Meyer, 15 years ago

Um, yeah. The first James there is James Turk, the second is James Bennett. Disambiguation FTW.

comment:12 by Gabriel Hurley, 14 years ago

Component: Contrib appscontrib.markup

comment:13 by Chris Beaven, 14 years ago

Severity: Normal
Type: New feature

comment:14 by Aymeric Augustin, 13 years ago

Easy pickings: unset
Needs documentation: set
Patch needs improvement: set
Triage Stage: Design decision neededAccepted
UI/UX: unset

This has been stuck in DDN for a long time. It's a small amount of code and it would be a reasonable addition to django.contrib.markup.

comment:15 by Claude Paroz, 12 years ago

Resolution: wontfix
Status: newclosed

contrib.markup has been deprecated (#18504) and will be removed in Django 1.6. Closing as obsolete.

Note: See TracTickets for help on using tickets.
Back to Top