0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Remove uses of Model._meta.description

Due to harsher restrictions on model Meta attributes in Django 1.6, it
is no longer possible to add a description attribute. This commit
removes any code in Wagtail that still tried to rely on a description
attribute.
This commit is contained in:
Tim Heap 2015-09-15 12:00:04 +10:00
parent 38e939b5a8
commit fff4568df7
4 changed files with 1 additions and 22 deletions

View File

@ -21,7 +21,6 @@
</div>
<small class="col6" style="text-align:right">
{{ content_type|meta_description }}
<a href="{% url 'wagtailadmin_pages:type_use' content_type.app_label content_type.model %}" class="nolink">{% blocktrans with page_type=content_type.model_class.get_verbose_name %}Pages using {{ page_type }}{% endblocktrans %}</a>
</small>

View File

@ -76,15 +76,6 @@ def widgettype(bound_field):
return ""
@register.filter
def meta_description(model):
try:
return model.model_class()._meta.description
except:
return ""
@register.assignment_tag(takes_context=True)
def page_permissions(context, page):
"""

View File

@ -7,7 +7,7 @@
<div class="nice-padding">
<ul class="listing">
{% for name, description, content_type in snippet_types %}
{% for name, content_type in snippet_types %}
<li>
<div class="row row-flush title">
<h2>
@ -15,7 +15,6 @@
{{ name|capfirst }}
</a>
</h2>
<small class="col6">{{ description }}</small>
</div>
</li>
{% endfor %}

View File

@ -31,15 +31,6 @@ def get_snippet_type_name(content_type):
)
def get_snippet_type_description(content_type):
""" return the meta description of the class associated with the given content type """
opts = content_type.model_class()._meta
try:
return force_text(opts.description)
except:
return ''
def get_content_type_from_url_params(app_name, model_name):
"""
retrieve a content type from an app_name / model_name combo.
@ -76,7 +67,6 @@ def index(request):
snippet_types = [
(
get_snippet_type_name(content_type)[1],
get_snippet_type_description(content_type),
content_type
)
for content_type in get_snippet_content_types()