# HG changeset patch # User Brian Neal # Date 1377735743 18000 # Node ID 7b52e8ef01eceda538a2522f37280020f0c054ae # Parent dcd097a59223a9e4251cfc4eb7f5ba62ab4be81e For Django 1.5: Remove usage of django.contrib.markup. Since we were only using Textile in one place, decided to stop using it altogether. Wrote a management command, untextile, to convert the gallery models' description fields from textile to raw HTML. This should be run one time before going live with Django 1.5. diff -r dcd097a59223 -r 7b52e8ef01ec band/management/commands/untextile.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/band/management/commands/untextile.py Wed Aug 28 19:22:23 2013 -0500 @@ -0,0 +1,20 @@ +""" +untextile.py - A command to remove the use of Textile by updating the models. + +""" +import textile + +from django.core.management.base import NoArgsCommand +from photologue.models import Gallery + + +class Command(NoArgsCommand): + help = 'Updates models by un-textiling text fields' + + def handle_noargs(self, **options): + + for gallery in Gallery.objects.all(): + gallery.description = textile.textile(gallery.description, + encoding='utf-8', + output='utf-8') + gallery.save() diff -r dcd097a59223 -r 7b52e8ef01ec madeira/settings/base.py --- a/madeira/settings/base.py Wed Aug 28 19:00:43 2013 -0500 +++ b/madeira/settings/base.py Wed Aug 28 19:22:23 2013 -0500 @@ -95,7 +95,6 @@ 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.flatpages', - 'django.contrib.markup', 'django.contrib.messages', 'django.contrib.sessions', 'django.contrib.sites', diff -r dcd097a59223 -r 7b52e8ef01ec madeira/templates/band/photo_detail.html --- a/madeira/templates/band/photo_detail.html Wed Aug 28 19:00:43 2013 -0500 +++ b/madeira/templates/band/photo_detail.html Wed Aug 28 19:22:23 2013 -0500 @@ -1,5 +1,4 @@ {% extends 'base.html' %} -{% load markup %} {% block title %}The Madeira | Photos: {{ gallery.title }}{% endblock %} {% block custom_css %} @@ -15,7 +14,7 @@ {% endblock %} {% block content %}

Madeira Photos: {{ gallery.title }}

-{{ gallery.description|textile }} +{{ gallery.description|safe }}
{% for photo in photos %} diff -r dcd097a59223 -r 7b52e8ef01ec madeira/templates/index.html --- a/madeira/templates/index.html Wed Aug 28 19:00:43 2013 -0500 +++ b/madeira/templates/index.html Wed Aug 28 19:22:23 2013 -0500 @@ -13,7 +13,6 @@ }); {% endblock %} -{% load markup %} {% block content %}

The Madeira