Merge lp://staging/~gepatino/ubuntu-accomplishments-web/icons_urls into lp://staging/ubuntu-accomplishments-web

Proposed by Gabriel Patiño
Status: Needs review
Proposed branch: lp://staging/~gepatino/ubuntu-accomplishments-web/icons_urls
Merge into: lp://staging/ubuntu-accomplishments-web
Diff against target: 361 lines (+112/-115)
7 files modified
common/models.py (+4/-0)
gallery/templates/gallery/opportunities/by_category.html (+2/-2)
gallery/templates/gallery/opportunities/details.html (+9/-9)
gallery/templates/gallery/trophies/by_category.html (+2/-2)
gallery/templates/gallery/trophies/by_collection.html (+2/-2)
gallery/templates/gallery/trophies/by_date.html (+2/-2)
gallery/views.py (+91/-98)
To merge this branch: bzr merge lp://staging/~gepatino/ubuntu-accomplishments-web/icons_urls
Reviewer Review Type Date Requested Status
Gabriel Patiño (community) Needs Resubmitting
ubuntu-accomplishments-web-editor-drivers Pending
Review via email: mp+113445@code.staging.launchpad.net

Description of the change

I've added a method to the Icon model to get it's url (Icon.url()), and changed the templates to use it.

Since templates needs an Icon object for this to work, and we were using queryset.values(...) which seems to return only fields data (not related objects), I also had to change this and return objects instead of only some fields.

The good thing is that gallery.views is now some lines of code shorter.

I guess we could also refactor it a little to avoid code duplication, but would be out of scope.

To post a comment you must log in.
191. By Gabriel Patiño

Merge from trunk

192. By Gabriel Patiño

Fixed multi category issue in trophies and opportunities

193. By Gabriel Patiño

Created a format_queryset method in the top level class for lists to reduce code duplication.

194. By Gabriel Patiño

PEP8 compliance

195. By Gabriel Patiño

Fixed Latest Trophies

196. By Gabriel Patiño

Fixed duplicated trophies in latest gallery for trophies with several categories.

197. By Gabriel Patiño

Setting back the number of days for latest gallery to seven.

Revision history for this message
Gabriel Patiño (gepatino) wrote :

I've been fixing some stuff Janos pointed to me by mail:

1. Now the rendered html is the same as the one generated by using the trunk.
2. I wasn't handle multicategories for opportunities and trhopies. It's now fixed
3. I'd removed accidentaly the labels Today and This Week in the Latest trophies page, fixed.

I had to clean up some code and then I realized we had code duplication when creating the data structure sent to the template.

I've created a format_queryset method to avoid duplication, and redefine it only when needed.

review: Needs Resubmitting

Unmerged revisions

197. By Gabriel Patiño

Setting back the number of days for latest gallery to seven.

196. By Gabriel Patiño

Fixed duplicated trophies in latest gallery for trophies with several categories.

195. By Gabriel Patiño

Fixed Latest Trophies

194. By Gabriel Patiño

PEP8 compliance

193. By Gabriel Patiño

Created a format_queryset method in the top level class for lists to reduce code duplication.

192. By Gabriel Patiño

Fixed multi category issue in trophies and opportunities

191. By Gabriel Patiño

Merge from trunk

190. By Gabriel Patiño

Changed the way icons urls are generated, and simplified galleries for trophies and opportunities

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches