)]}'
{"horizon/tables/views.py":[{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"9b3a13ffb91aed89f2139a76d978bcd83c0da1a3","unresolved":false,"context_lines":[{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def get_context_data(self, **kwargs):"},{"line_number":160,"context_line":"        context \u003d super(MultiTableView, self).get_context_data(**kwargs)"},{"line_number":161,"context_line":"        context[\"page_title\"] \u003d self.page_title % self.title_data()"},{"line_number":162,"context_line":"        return context"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def get(self, request, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_a1ee5389","line":161,"updated":"2014-12-18 17:01:13.000000000","message":"Prefer to see get_context_data get define in PageTitleMixin. This way, subclasses like MultiTableView and TabView do not need to instantiate context[\"page_title\"]. Might also be a good idea to initialize page_title and title_data to some value. And if feasible, would be nice to also enforce that page_title exists for any declared view (but I realize that this might not be possible unless you refactor every view).","commit_id":"e89a79fc71d6216d9d5db085c92b192dc47b6f84"},{"author":{"_account_id":8040,"name":"Timur Sufiev","email":"tsufiev@gmail.com","username":"tsufiev"},"change_message_id":"d3fc009df7c87fb6708848ef552a523660e8dd93","unresolved":false,"context_lines":[{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def get_context_data(self, **kwargs):"},{"line_number":160,"context_line":"        context \u003d super(MultiTableView, self).get_context_data(**kwargs)"},{"line_number":161,"context_line":"        context[\"page_title\"] \u003d self.page_title % self.title_data()"},{"line_number":162,"context_line":"        return context"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def get(self, request, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_e205a07a","line":161,"in_reply_to":"3a961159_a1ee5389","updated":"2014-12-19 12:15:51.000000000","message":"+1","commit_id":"e89a79fc71d6216d9d5db085c92b192dc47b6f84"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"d28933489fbf58047733ec75645295f5a9aa21a3","unresolved":false,"context_lines":[{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def get_context_data(self, **kwargs):"},{"line_number":160,"context_line":"        context \u003d super(MultiTableView, self).get_context_data(**kwargs)"},{"line_number":161,"context_line":"        context[\"page_title\"] \u003d self.page_title % self.title_data()"},{"line_number":162,"context_line":"        return context"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def get(self, request, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_04cd75b7","line":161,"in_reply_to":"3a961159_e205a07a","updated":"2015-01-05 14:17:39.000000000","message":"Done","commit_id":"e89a79fc71d6216d9d5db085c92b192dc47b6f84"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"89cc1a46072884295304d40e7bea8a198e1f0783","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        # with the view as normal."},{"line_number":158,"context_line":"        return None"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def get_context_data(self, **kwargs):"},{"line_number":161,"context_line":"        context \u003d super(MultiTableView, self).get_context_data(**kwargs)"},{"line_number":162,"context_line":"        context[\"page_title\"] \u003d self.page_title % self.title_data()"},{"line_number":163,"context_line":"        return context"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_6600f902","line":160,"updated":"2015-01-05 17:54:13.000000000","message":"can be done in PageTitleMixin as previous mentioned.","commit_id":"97dbf767d98cce53399792e6f30e44709790de04"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"26c42144efd10d8c141b38fd282370287c8a6f9a","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        # with the view as normal."},{"line_number":158,"context_line":"        return None"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def get_context_data(self, **kwargs):"},{"line_number":161,"context_line":"        context \u003d super(MultiTableView, self).get_context_data(**kwargs)"},{"line_number":162,"context_line":"        context[\"page_title\"] \u003d self.page_title % self.title_data()"},{"line_number":163,"context_line":"        return context"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_fc6e39ff","line":160,"in_reply_to":"3a961159_6600f902","updated":"2015-01-06 12:58:20.000000000","message":"Done, I didn\u0027t realise that calling super in a mixin would return to MultiTableViews inheritance chain.","commit_id":"97dbf767d98cce53399792e6f30e44709790de04"}],"horizon/test/tests/views.py":[{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"6b91937b21d45f3740fe2a52e630b274cf2cc778","unresolved":false,"context_lines":[{"line_number":23,"context_line":"    def get_context_data(self):"},{"line_number":24,"context_line":"        return {\"object\": {\u0027name\u0027: \u0027myName\u0027}}"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class PageWithNoTitle(views.PageTitleMixin, FakeTemplate):"},{"line_number":28,"context_line":"    pass"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"fa81d914_ce50c5d6","line":26,"updated":"2015-01-30 11:04:15.000000000","message":"Ideally we should add tests with some/all View classes here.","commit_id":"0122746e597527211a6536ce68025df7996f1110"},{"author":{"_account_id":12826,"name":"Rob Cresswell","display_name":"robcresswell","email":"robert.cresswell@outlook.com","username":"rob-cresswell"},"change_message_id":"ee73ca766cfb8f20e4148964d5d45296025f5fd8","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"class TestForm(forms.Form):"},{"line_number":49,"context_line":"    pass"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"class FormWithTitle(ViewData, views.HorizonFormView):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_72ac77ee","line":49,"updated":"2015-02-02 16:29:37.000000000","message":"This can be removed","commit_id":"fc98922770cbeeaa7ec23d63f30c1f6f8b87cf7e"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"b0d2fbd05d5eb18954cad7adfe27899b985a0226","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"class TestForm(forms.Form):"},{"line_number":49,"context_line":"    pass"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"class FormWithTitle(ViewData, views.HorizonFormView):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da86d52c_7551c161","line":49,"in_reply_to":"da86d52c_72ac77ee","updated":"2015-02-02 16:39:23.000000000","message":"Done","commit_id":"fc98922770cbeeaa7ec23d63f30c1f6f8b87cf7e"}],"horizon/utils/pagetitle.py":[{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"9b3a13ffb91aed89f2139a76d978bcd83c0da1a3","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"class PageTitleMixin(object):"},{"line_number":17,"context_line":"    page_title \u003d \"\""},{"line_number":18,"context_line":"    title_data_source \u003d \"get_data\""},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_012ac72b","line":16,"updated":"2014-12-18 17:01:13.000000000","message":"not sure utils is the best place to put a view mixin.","commit_id":"e89a79fc71d6216d9d5db085c92b192dc47b6f84"},{"author":{"_account_id":8040,"name":"Timur Sufiev","email":"tsufiev@gmail.com","username":"tsufiev"},"change_message_id":"d3fc009df7c87fb6708848ef552a523660e8dd93","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"class PageTitleMixin(object):"},{"line_number":17,"context_line":"    page_title \u003d \"\""},{"line_number":18,"context_line":"    title_data_source \u003d \"get_data\""},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_8294dc8b","line":16,"in_reply_to":"3a961159_012ac72b","updated":"2014-12-19 12:15:51.000000000","message":"Agree. How about using horizon.views module for that?","commit_id":"e89a79fc71d6216d9d5db085c92b192dc47b6f84"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"d28933489fbf58047733ec75645295f5a9aa21a3","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"class PageTitleMixin(object):"},{"line_number":17,"context_line":"    page_title \u003d \"\""},{"line_number":18,"context_line":"    title_data_source \u003d \"get_data\""},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_04449519","line":16,"in_reply_to":"3a961159_8294dc8b","updated":"2015-01-05 14:17:39.000000000","message":"Done","commit_id":"e89a79fc71d6216d9d5db085c92b192dc47b6f84"},{"author":{"_account_id":8040,"name":"Timur Sufiev","email":"tsufiev@gmail.com","username":"tsufiev"},"change_message_id":"d3fc009df7c87fb6708848ef552a523660e8dd93","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    def title_data(self):"},{"line_number":21,"context_line":"        if self.page_title !\u003d \"\":"},{"line_number":22,"context_line":"            try:"},{"line_number":23,"context_line":"                f \u003d getattr(self, self.title_data_source)"},{"line_number":24,"context_line":"                return {\"name\": f().name}"},{"line_number":25,"context_line":"            except Exception:"},{"line_number":26,"context_line":"                pass"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_82005c35","line":23,"updated":"2014-12-19 12:15:51.000000000","message":"This indeed makes code less verbose, but at the same time makes it more difficult to read, including code navigation tools (e.g. PyCharm). I suggest making title_data() more straightforward - just returning some dictionary with data, while moving more complex logic into get_context_data() implemented in this mixin - as Thai suggested in comment in another file.","commit_id":"e89a79fc71d6216d9d5db085c92b192dc47b6f84"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"d28933489fbf58047733ec75645295f5a9aa21a3","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    def title_data(self):"},{"line_number":21,"context_line":"        if self.page_title !\u003d \"\":"},{"line_number":22,"context_line":"            try:"},{"line_number":23,"context_line":"                f \u003d getattr(self, self.title_data_source)"},{"line_number":24,"context_line":"                return {\"name\": f().name}"},{"line_number":25,"context_line":"            except Exception:"},{"line_number":26,"context_line":"                pass"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_446cdd9d","line":23,"in_reply_to":"3a961159_82005c35","updated":"2015-01-05 14:17:39.000000000","message":"Done","commit_id":"e89a79fc71d6216d9d5db085c92b192dc47b6f84"},{"author":{"_account_id":8040,"name":"Timur Sufiev","email":"tsufiev@gmail.com","username":"tsufiev"},"change_message_id":"d3fc009df7c87fb6708848ef552a523660e8dd93","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        return {}"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def get_data(self):"},{"line_number":30,"context_line":"        raise NotImplementedError()"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_c2e1842b","line":30,"updated":"2014-12-19 12:15:51.000000000","message":"It\u0027s better to return empty dict here, because raising an exception will prevent from using super(..., ...).get_data().","commit_id":"e89a79fc71d6216d9d5db085c92b192dc47b6f84"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"d28933489fbf58047733ec75645295f5a9aa21a3","unresolved":false,"context_lines":[{"line_number":27,"context_line":"        return {}"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def get_data(self):"},{"line_number":30,"context_line":"        raise NotImplementedError()"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_84b88512","line":30,"in_reply_to":"3a961159_c2e1842b","updated":"2015-01-05 14:17:39.000000000","message":"Done","commit_id":"e89a79fc71d6216d9d5db085c92b192dc47b6f84"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"89cc1a46072884295304d40e7bea8a198e1f0783","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"class PageTitleMixin(object):"},{"line_number":17,"context_line":"    page_title \u003d \"\""},{"line_number":18,"context_line":"    title_data_source \u003d \"get_data\""},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_46805d8b","line":16,"updated":"2015-01-05 17:54:13.000000000","message":"duplicated code, no longer needed?","commit_id":"97dbf767d98cce53399792e6f30e44709790de04"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"26c42144efd10d8c141b38fd282370287c8a6f9a","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"class PageTitleMixin(object):"},{"line_number":17,"context_line":"    page_title \u003d \"\""},{"line_number":18,"context_line":"    title_data_source \u003d \"get_data\""},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_fc271961","line":16,"in_reply_to":"3a961159_46805d8b","updated":"2015-01-06 12:58:20.000000000","message":"Done","commit_id":"97dbf767d98cce53399792e6f30e44709790de04"}],"horizon/views.py":[{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"5d34f7a64096c878acbc76516113a754714c1101","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    def title_data(self):"},{"line_number":57,"context_line":"        try:"},{"line_number":58,"context_line":"            if self.page_title !\u003d \"\":"},{"line_number":59,"context_line":"                return {\"name\": self.get_data().name}"},{"line_number":60,"context_line":"        except Exception:"},{"line_number":61,"context_line":"            pass"},{"line_number":62,"context_line":"        return {\"name\": \"\"}"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_4fba0de2","line":59,"updated":"2015-01-06 18:03:28.000000000","message":"This will be guarantee in subclasses of table views but not for tab views. Not sure it can be universally assumed here.","commit_id":"6ae5e0db708e1d621a38d893138a79a77a8d7ad6"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"5d34f7a64096c878acbc76516113a754714c1101","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        context[\"page_title\"] \u003d self.page_title % self.title_data()"},{"line_number":67,"context_line":"        return context"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def get_data(self):"},{"line_number":70,"context_line":"        return {}"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_cfdc3d77","line":69,"updated":"2015-01-06 18:03:28.000000000","message":"From my understanding, this method is a table view construct and is not present in tab view. But many views in the dashboard that inherit the tab view contains this method. In addition, it looks like table view is returning an array as oppose to a dict.","commit_id":"6ae5e0db708e1d621a38d893138a79a77a8d7ad6"},{"author":{"_account_id":8040,"name":"Timur Sufiev","email":"tsufiev@gmail.com","username":"tsufiev"},"change_message_id":"e7cd42c618284d9b778df4ccad59802e3b7f2b18","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def get_context_data(self, **kwargs):"},{"line_number":60,"context_line":"        context \u003d super(PageTitleMixin, self).get_context_data(**kwargs)"},{"line_number":61,"context_line":"        context[\"page_title\"] \u003d self.page_title % self.title_data()"},{"line_number":62,"context_line":"        return context"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_e3d1f457","line":62,"updated":"2015-01-07 16:58:37.000000000","message":"What\u0027s about one more test to see whether `title_data()` properly functions?","commit_id":"da10d07ce8174ca787f1b3fe76773d2ae29c0443"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"f9c287185b4d041b713e637cd9d821a47eda1925","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def get_context_data(self, **kwargs):"},{"line_number":60,"context_line":"        context \u003d super(PageTitleMixin, self).get_context_data(**kwargs)"},{"line_number":61,"context_line":"        context[\"page_title\"] \u003d self.page_title % self.title_data()"},{"line_number":62,"context_line":"        return context"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_98ba41be","line":62,"in_reply_to":"3a961159_e3d1f457","updated":"2015-01-08 12:34:33.000000000","message":"Done","commit_id":"da10d07ce8174ca787f1b3fe76773d2ae29c0443"},{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"ccf6e3372c2178caa5383034670ce6b00ce070fd","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def get_context_data(self, **kwargs):"},{"line_number":60,"context_line":"        context \u003d super(PageTitleMixin, self).get_context_data(**kwargs)"},{"line_number":61,"context_line":"        context[\"page_title\"] \u003d self.page_title % self.title_data(**kwargs)"},{"line_number":62,"context_line":"        return context"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa81d914_6a99be1e","line":61,"updated":"2015-01-29 10:12:54.000000000","message":"Usually the context contains the important information for page title. As I see in the views that have custom title_data, they all use some value from context actually.\n\nSo, we can instead use the internal Django templates, e.g.:\n\n\n    class SomeClass(PageTitleMixin):\n\n        page_title \u003d _(\"Page {{ namespace.name }}\")\n\n\n\nand then in the Mixin class:\n\n\n    from django.template import Template, Context\n\n    class PageTitleMixin(object):\n\n        def gen_title(self, context):\n\n            context \u003d Context(super(PageTitleMixin, self).get_context_data(**kwargs))\n            t \u003d Template(self.page_title)\n            context[\"page_title\"] \u003d t.render(Context(context))\n\n\nSo it is enough to just have in the context:\n\n    context[\"namespace\"] \u003d some_object_with_name_prop\n\nand this will work, without the need to add a new method \"title_data()\". And I can even see that there is no need for the Mixin class, this can be made as a method in the ApiView class. So any class that cannot construct the page title with the context - will just override the \"get_title\" method.\n\nNote: I hope the template tags - \"{{ }}\" will not cause problems for the i18n,","commit_id":"9816e8918ef77705e9dfd651ffd8078b3abf9582"},{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"6b91937b21d45f3740fe2a52e630b274cf2cc778","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from horizon import exceptions"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class PageTitleMixin(object):"},{"line_number":24,"context_line":"    page_title \u003d \"\""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def render_title(self, context):"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa81d914_ee8ae919","line":23,"updated":"2015-01-30 11:04:15.000000000","message":"I think this mixin should be available to all Views, so why not making a class BaseTemplateView(generic.TemplateView) with the page_title functions, and then sub-class all Views that currently use generic.TemplateView with the BaseTemplateView? This new base View might be used later for other common operations. Maybe some configurable \"META\" tags on all pages..","commit_id":"0122746e597527211a6536ce68025df7996f1110"},{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"6b91937b21d45f3740fe2a52e630b274cf2cc778","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        # NOTE(sambetts): Cast to unicode to ensure lazy translations"},{"line_number":29,"context_line":"        # are handled correctly"},{"line_number":30,"context_line":"        temp \u003d template.Template(unicode(self.page_title))"},{"line_number":31,"context_line":"        if \"page_title\" not in context:"},{"line_number":32,"context_line":"            context[\"page_title\"] \u003d temp.render(con)"},{"line_number":33,"context_line":"        return context"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"fa81d914_0b33af63","line":31,"updated":"2015-01-30 11:04:15.000000000","message":"Assignments of variables \u0027con\u0027 and \u0027temp\u0027 should be made after the \u0027if\u0027, otherwise they might be instantiated and not used.","commit_id":"0122746e597527211a6536ce68025df7996f1110"},{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"fde2c95e6304e99af2ec0bc42c78115c4695ba58","unresolved":false,"context_lines":[{"line_number":23,"context_line":"class PageTitleMixin(object):"},{"line_number":24,"context_line":"    page_title \u003d \"\""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def render_title(self, context):"},{"line_number":27,"context_line":"        if \"page_title\" not in context:"},{"line_number":28,"context_line":"            con \u003d template.Context(context)"},{"line_number":29,"context_line":"            # NOTE(sambetts): Cast to unicode to ensure lazy translations"}],"source_content_type":"text/x-python","patch_set":14,"id":"da86d52c_95c33188","line":26,"updated":"2015-02-04 15:03:23.000000000","message":"The method name is kind of confusing. What about renaming it to \"pre_render_context()\" or similar? Since it receives a context object and returns the same context object.","commit_id":"73baa820674cde5f0587efb26696a4c54bf3b58e"},{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"fde2c95e6304e99af2ec0bc42c78115c4695ba58","unresolved":false,"context_lines":[{"line_number":28,"context_line":"            con \u003d template.Context(context)"},{"line_number":29,"context_line":"            # NOTE(sambetts): Cast to unicode to ensure lazy translations"},{"line_number":30,"context_line":"            # are handled correctly."},{"line_number":31,"context_line":"            temp \u003d template.Template(unicode(self.page_title))"},{"line_number":32,"context_line":"            context[\"page_title\"] \u003d temp.render(con)"},{"line_number":33,"context_line":"        return context"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"da86d52c_5580d945","line":31,"updated":"2015-02-04 15:03:23.000000000","message":"Isn\u0027t it better to use the Django utils[1] here:\n\n     force_text(self.page_title)\n\nI think Django utils have some more sophisticated handling of lazy objects.\n\n[1] https://docs.djangoproject.com/en/1.7/ref/utils/#django.utils.encoding.force_text","commit_id":"73baa820674cde5f0587efb26696a4c54bf3b58e"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"962ad90441ea48cdab3fbb9e61d2d7bd10fb5365","unresolved":false,"context_lines":[{"line_number":23,"context_line":"class PageTitleMixin(object):"},{"line_number":24,"context_line":"    page_title \u003d \"\""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def render_title(self, context):"},{"line_number":27,"context_line":"        if \"page_title\" not in context:"},{"line_number":28,"context_line":"            con \u003d template.Context(context)"},{"line_number":29,"context_line":"            # NOTE(sambetts): Cast to unicode to ensure lazy translations"}],"source_content_type":"text/x-python","patch_set":16,"id":"da86d52c_8193fc59","line":26,"updated":"2015-02-11 09:59:05.000000000","message":"I think this method deserves more comments. It took me a few good minutes to figure out why you did what you did. You need to explain that the page title can be use as a template and provide example of how it can be use.\n\nHaving said all of that, I don\u0027t see it as a blocker as long as you go back and append the comments in a follow on patch. Good work here Sam!","commit_id":"36a95d810042fef9b1591e7a8d64e2ae707fc4d0"}],"openstack_dashboard/dashboards/project/database_backups/views.py":[{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"b872a4e50c699da0738e3271c43e07bef2d54bfe","unresolved":false,"context_lines":[{"line_number":76,"context_line":"class DetailView(horizon_views.APIView):"},{"line_number":77,"context_line":"    template_name \u003d \"project/database_backups/details.html\""},{"line_number":78,"context_line":"    page_title \u003d _(\"Backup Details: %(backup_name)s\")"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def get_data(self, request, context, *args, **kwargs):"},{"line_number":81,"context_line":"        context \u003d super(DetailView, self).get_data("},{"line_number":82,"context_line":"            request, context, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_2a4ef338","line":79,"updated":"2015-01-13 00:45:21.000000000","message":"did you forget def title_data(self, **kwargs) here? or did I miss something?","commit_id":"44a8736aa99fc82ec7f45acd5534f9c3ddf8e220"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"f4702649c6f7a4175b5750b219d38ae131d6bee9","unresolved":false,"context_lines":[{"line_number":76,"context_line":"class DetailView(horizon_views.APIView):"},{"line_number":77,"context_line":"    template_name \u003d \"project/database_backups/details.html\""},{"line_number":78,"context_line":"    page_title \u003d _(\"Backup Details: %(backup_name)s\")"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def get_data(self, request, context, *args, **kwargs):"},{"line_number":81,"context_line":"        context \u003d super(DetailView, self).get_data("},{"line_number":82,"context_line":"            request, context, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_8b1fcdb7","line":79,"in_reply_to":"3a961159_2a4ef338","updated":"2015-01-13 18:22:45.000000000","message":"This is weird edge case, which doesn\u0027t seem to fit the patterns of the other views, and I have not actually extended APIView with the mixin for this reason, but I decided that even without using the mixin I could get this class to include a page_title variable so that it was half way there for use in the future.","commit_id":"44a8736aa99fc82ec7f45acd5534f9c3ddf8e220"}],"openstack_dashboard/dashboards/project/firewalls/views.py":[{"author":{"_account_id":2455,"name":"Tihomir Trifonov","email":"t.trifonov@gmail.com","username":"ttrifonov"},"change_message_id":"6b91937b21d45f3740fe2a52e630b274cf2cc778","unresolved":false,"context_lines":[{"line_number":116,"context_line":"    template_name \u003d \u0027project/firewalls/details_tabs.html\u0027"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"class UpdateRuleView(forms.ModalFormView):"},{"line_number":120,"context_line":"    form_class \u003d UpdateRule"},{"line_number":121,"context_line":"    template_name \u003d \"project/firewalls/updaterule.html\""},{"line_number":122,"context_line":"    context_object_name \u003d \u0027rule\u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa81d914_6eb19946","line":119,"updated":"2015-01-30 11:04:15.000000000","message":"forms.ModalFormView doesn\u0027t seem to implement the PageTitleMixin?","commit_id":"0122746e597527211a6536ce68025df7996f1110"}],"openstack_dashboard/dashboards/project/stacks/views.py":[{"author":{"_account_id":8040,"name":"Timur Sufiev","email":"tsufiev@gmail.com","username":"tsufiev"},"change_message_id":"e7cd42c618284d9b778df4ccad59802e3b7f2b18","unresolved":false,"context_lines":[{"line_number":205,"context_line":"        context[\"url\"] \u003d self.get_redirect_url()"},{"line_number":206,"context_line":"        context[\"actions\"] \u003d table.render_row_actions(stack)"},{"line_number":207,"context_line":"        context[\"page_title\"] \u003d (_(\"Stack Details: %(stack_name)s\") %"},{"line_number":208,"context_line":"                                 {\u0027stack_name\u0027: stack.stack_name})"},{"line_number":209,"context_line":"        return context"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    @memoized.memoized_method"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_2333fc62","line":208,"updated":"2015-01-07 16:58:37.000000000","message":"Why not use the same pattern with `page_title` attr and `title_data()` call here? Since `get_data()` is memoized, there won\u0027t be performance penalty.","commit_id":"da10d07ce8174ca787f1b3fe76773d2ae29c0443"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"f9c287185b4d041b713e637cd9d821a47eda1925","unresolved":false,"context_lines":[{"line_number":205,"context_line":"        context[\"url\"] \u003d self.get_redirect_url()"},{"line_number":206,"context_line":"        context[\"actions\"] \u003d table.render_row_actions(stack)"},{"line_number":207,"context_line":"        context[\"page_title\"] \u003d (_(\"Stack Details: %(stack_name)s\") %"},{"line_number":208,"context_line":"                                 {\u0027stack_name\u0027: stack.stack_name})"},{"line_number":209,"context_line":"        return context"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    @memoized.memoized_method"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_78de7512","line":208,"in_reply_to":"3a961159_2333fc62","updated":"2015-01-08 12:34:33.000000000","message":"Done","commit_id":"da10d07ce8174ca787f1b3fe76773d2ae29c0443"}]}
