aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2011-11-23 00:10:42 +0100
committerElrond <elrond+mediagoblin.org@samba-tng.org>2011-12-05 21:08:58 +0100
commitec82fbd85c93c88d177e9f5c7a7414a2b47fa17e (patch)
treeadefa1d036acc06a001b64cc1eb08f0448204ae4
parent1ceb4fc8682dd00c15376b75a3d9222cac6fb5bd (diff)
downloadmediagoblin-ec82fbd85c93c88d177e9f5c7a7414a2b47fa17e.tar.lz
mediagoblin-ec82fbd85c93c88d177e9f5c7a7414a2b47fa17e.tar.xz
mediagoblin-ec82fbd85c93c88d177e9f5c7a7414a2b47fa17e.zip
Dot-Notation for MediaEntry.title
-rw-r--r--mediagoblin/db/models.py2
-rw-r--r--mediagoblin/edit/views.py4
-rw-r--r--mediagoblin/gmg_commands/import_export.py4
-rw-r--r--mediagoblin/submit/views.py2
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html2
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/processing_panel.html4
-rw-r--r--mediagoblin/templates/mediagoblin/utils/object_gallery.html4
7 files changed, 11 insertions, 11 deletions
diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py
index f1f56dd1..7af76b9f 100644
--- a/mediagoblin/db/models.py
+++ b/mediagoblin/db/models.py
@@ -249,7 +249,7 @@ class MediaEntry(Document):
pass
def generate_slug(self):
- self['slug'] = url.slugify(self['title'])
+ self['slug'] = url.slugify(self.title)
duplicate = mg_globals.database.media_entries.find_one(
{'slug': self['slug']})
diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py
index 0b84f639..feda397d 100644
--- a/mediagoblin/edit/views.py
+++ b/mediagoblin/edit/views.py
@@ -43,7 +43,7 @@ def edit_media(request, media):
return exc.HTTPForbidden()
defaults = dict(
- title=media['title'],
+ title=media.title,
slug=media['slug'],
description=media['description'],
tags=media_tags_as_string(media['tags']))
@@ -64,7 +64,7 @@ def edit_media(request, media):
form.slug.errors.append(
_(u'An entry with that slug already exists for this user.'))
else:
- media['title'] = unicode(request.POST['title'])
+ media.title = unicode(request.POST['title'])
media['description'] = unicode(request.POST.get('description'))
media['tags'] = convert_to_tag_list_of_dicts(
request.POST.get('tags'))
diff --git a/mediagoblin/gmg_commands/import_export.py b/mediagoblin/gmg_commands/import_export.py
index 4ec17d47..1308f09e 100644
--- a/mediagoblin/gmg_commands/import_export.py
+++ b/mediagoblin/gmg_commands/import_export.py
@@ -67,7 +67,7 @@ def _import_media(db, args):
for entry in db.media_entries.find():
for name, path in entry['media_files'].items():
_log.info('Importing: {0} - {1}'.format(
- entry['title'],
+ entry.title,
name))
media_file = mg_globals.public_store.get_file(path, mode='wb')
@@ -209,7 +209,7 @@ def _export_media(db, args):
for entry in db.media_entries.find():
for name, path in entry['media_files'].items():
_log.info(u'Exporting {0} - {1}'.format(
- entry['title'],
+ entry.title,
name))
try:
mc_file = media_cache.get_file(path, mode='wb')
diff --git a/mediagoblin/submit/views.py b/mediagoblin/submit/views.py
index 64d4b541..1805e293 100644
--- a/mediagoblin/submit/views.py
+++ b/mediagoblin/submit/views.py
@@ -56,7 +56,7 @@ def submit_start(request):
entry = request.db.MediaEntry()
entry['_id'] = ObjectId()
entry['media_type'] = unicode(media_type)
- entry['title'] = (
+ entry.title = (
unicode(request.POST['title'])
or unicode(splitext(filename)[0]))
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html
index 058351a5..7c7218ae 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html
@@ -27,7 +27,7 @@
method="POST" enctype="multipart/form-data">
<div class="grid_8 prefix_1 suffix_1 edit_box form_box">
<h1>
- {%- trans title=media['title'] -%}
+ {%- trans title=media.title -%}
Really delete {{ title }}?
{%- endtrans %}
</h1>
diff --git a/mediagoblin/templates/mediagoblin/user_pages/processing_panel.html b/mediagoblin/templates/mediagoblin/user_pages/processing_panel.html
index 307a0027..a14b0123 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/processing_panel.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/processing_panel.html
@@ -36,7 +36,7 @@
</tr>
{% for media_entry in processing_entries %}
<tr>
- <td>{{ media_entry['title'] }}</td>
+ <td>{{ media_entry.title }}</td>
<td>{{ media_entry.created.strftime("%m-%d-%Y %I:%M %p") }}</td>
<td></td>
</tr>
@@ -57,7 +57,7 @@
</tr>
{% for media_entry in failed_entries %}
<tr>
- <td>{{ media_entry['title'] }}</td>
+ <td>{{ media_entry.title }}</td>
<td>{{ media_entry['created'].strftime("%m-%d-%Y %I:%M %p") }}</td>
<td>{{ media_entry.get_fail_exception().general_message }}</td>
</tr>
diff --git a/mediagoblin/templates/mediagoblin/utils/object_gallery.html b/mediagoblin/templates/mediagoblin/utils/object_gallery.html
index e1b8cc9b..65ff09a4 100644
--- a/mediagoblin/templates/mediagoblin/utils/object_gallery.html
+++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html
@@ -33,9 +33,9 @@
<img src="{{ request.app.public_store.file_url(
entry['media_files']['thumb']) }}" />
</a>
- {% if entry['title'] %}
+ {% if entry.title %}
<br />
- <a href="{{ entry_url }}">{{ entry['title'] }}</a>
+ <a href="{{ entry_url }}">{{ entry.title }}</a>
{% endif %}
</td>
{% endfor %}