Skip to content

Commit

Permalink
[2445] Converted related types into a dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
aron committed Jun 5, 2012
1 parent 69fc410 commit f02e887
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ckan/controllers/related.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ def _edit_or_new(self, id, related_id, is_edit):
if is_edit:
data = related

c.types = (
("Application", "application"),
("Idea", "idea"),
("News Article", "news_article"),
("Paper", "paper"),
("Visualization", "visualization")
)
c.types = {
"application": "Application",
"idea": "Idea",
"news_article": "News Article",
"paper": "Paper",
"visualization": "Visualization"
}

This comment has been minimized.

Copy link
@aron

aron Jun 5, 2012

Author Contributor

@rossjones @tobes I've converted this into a dict as that's what my form helper was using. Is it a convention in Python to do key/value pairs with tuples? If so I'll update my helper and revert this change.


vars = {'data': data, 'errors': errors, 'error_summary': error_summary}
c.form = base.render("related/edit_form.html", extra_vars=vars)
return base.render(tpl)
return base.render(tpl)

0 comments on commit f02e887

Please sign in to comment.