{"action":"created","issue":{"url":"https://api.github.com/repos/fidals/shopelectro/issues/550","repository_url":"https://api.github.com/repos/fidals/shopelectro","labels_url":"https://api.github.com/repos/fidals/shopelectro/issues/550/labels{/name}","comments_url":"https://api.github.com/repos/fidals/shopelectro/issues/550/comments","events_url":"https://api.github.com/repos/fidals/shopelectro/issues/550/events","html_url":"https://github.com/fidals/shopelectro/issues/550","id":354259062,"node_id":"MDU6SXNzdWUzNTQyNTkwNjI=","number":550,"title":"Split CatalogPage's monolith code","user":{"login":"duker33","id":3526796,"node_id":"MDQ6VXNlcjM1MjY3OTY=","avatar_url":"https://avatars1.githubusercontent.com/u/3526796?v=4","gravatar_id":"","url":"https://api.github.com/users/duker33","html_url":"https://github.com/duker33","followers_url":"https://api.github.com/users/duker33/followers","following_url":"https://api.github.com/users/duker33/following{/other_user}","gists_url":"https://api.github.com/users/duker33/gists{/gist_id}","starred_url":"https://api.github.com/users/duker33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duker33/subscriptions","organizations_url":"https://api.github.com/users/duker33/orgs","repos_url":"https://api.github.com/users/duker33/repos","events_url":"https://api.github.com/users/duker33/events{/privacy}","received_events_url":"https://api.github.com/users/duker33/received_events","type":"User","site_admin":false},"labels":[{"id":722199473,"node_id":"MDU6TGFiZWw3MjIxOTk0NzM=","url":"https://api.github.com/repos/fidals/shopelectro/labels/1","name":"1","color":"f3f3f3","default":false},{"id":707838017,"node_id":"MDU6TGFiZWw3MDc4MzgwMTc=","url":"https://api.github.com/repos/fidals/shopelectro/labels/2%20hours","name":"2 hours","color":"eb6421","default":false},{"id":1036617526,"node_id":"MDU6TGFiZWwxMDM2NjE3NTI2","url":"https://api.github.com/repos/fidals/shopelectro/labels/Tags","name":"Tags","color":"ffffff","default":false},{"id":848958992,"node_id":"MDU6TGFiZWw4NDg5NTg5OTI=","url":"https://api.github.com/repos/fidals/shopelectro/labels/blocker","name":"blocker","color":"cc0701","default":false},{"id":848960921,"node_id":"MDU6TGFiZWw4NDg5NjA5MjE=","url":"https://api.github.com/repos/fidals/shopelectro/labels/cleanup","name":"cleanup","color":"bfd4f2","default":false},{"id":1038887274,"node_id":"MDU6TGFiZWwxMDM4ODg3Mjc0","url":"https://api.github.com/repos/fidals/shopelectro/labels/x2","name":"x2","color":"eb6421","default":false}],"state":"open","locked":false,"assignee":{"login":"duker33","id":3526796,"node_id":"MDQ6VXNlcjM1MjY3OTY=","avatar_url":"https://avatars1.githubusercontent.com/u/3526796?v=4","gravatar_id":"","url":"https://api.github.com/users/duker33","html_url":"https://github.com/duker33","followers_url":"https://api.github.com/users/duker33/followers","following_url":"https://api.github.com/users/duker33/following{/other_user}","gists_url":"https://api.github.com/users/duker33/gists{/gist_id}","starred_url":"https://api.github.com/users/duker33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duker33/subscriptions","organizations_url":"https://api.github.com/users/duker33/orgs","repos_url":"https://api.github.com/users/duker33/repos","events_url":"https://api.github.com/users/duker33/events{/privacy}","received_events_url":"https://api.github.com/users/duker33/received_events","type":"User","site_admin":false},"assignees":[{"login":"duker33","id":3526796,"node_id":"MDQ6VXNlcjM1MjY3OTY=","avatar_url":"https://avatars1.githubusercontent.com/u/3526796?v=4","gravatar_id":"","url":"https://api.github.com/users/duker33","html_url":"https://github.com/duker33","followers_url":"https://api.github.com/users/duker33/followers","following_url":"https://api.github.com/users/duker33/following{/other_user}","gists_url":"https://api.github.com/users/duker33/gists{/gist_id}","starred_url":"https://api.github.com/users/duker33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duker33/subscriptions","organizations_url":"https://api.github.com/users/duker33/orgs","repos_url":"https://api.github.com/users/duker33/repos","events_url":"https://api.github.com/users/duker33/events{/privacy}","received_events_url":"https://api.github.com/users/duker33/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-08-27T10:08:00Z","updated_at":"2018-09-03T15:05:41Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"shopelectro.views.catalog.CategoryPage currently consists of this steps:\r\n- get products\r\n- filter tags\r\n- get template context\r\n- paginate products\r\n\r\nAll these steps are semantically separated from CategoryPage and from each other.\r\nHere is good code draft example for `get products` + `filter tags`.\r\n\r\n```\r\nclass CategoryPage:\r\n\r\n    def __init__(self, category_id):\r\n        pass\r\n\r\n    def products(self) -> 'QuerySet':\r\n        return None\r\n\r\n    def get_context_data(self):\r\n        return {}\r\n\r\n\r\nclass TaggedCategoryPage:\r\n    def __init__(self, page: CategoryPage, tags):\r\n        self.super = page\r\n\r\n    def products(self) -> 'QuerySet':\r\n        return super.products.filter(smth=anyth)\r\n\r\n    def get_context_data(self):\r\n        context = self.super.get_context_data()\r\n        data = {}\r\n        return {\r\n            'all_products': products,\r\n            **data,\r\n            **context,\r\n        }\r\n```\r\n\r\nBut use in this task traditional inheritance instead of objects composition\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/fidals/shopelectro/issues/comments/418140546","html_url":"https://github.com/fidals/shopelectro/issues/550#issuecomment-418140546","issue_url":"https://api.github.com/repos/fidals/shopelectro/issues/550","id":418140546,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODE0MDU0Ng==","user":{"login":"duker33","id":3526796,"node_id":"MDQ6VXNlcjM1MjY3OTY=","avatar_url":"https://avatars1.githubusercontent.com/u/3526796?v=4","gravatar_id":"","url":"https://api.github.com/users/duker33","html_url":"https://github.com/duker33","followers_url":"https://api.github.com/users/duker33/followers","following_url":"https://api.github.com/users/duker33/following{/other_user}","gists_url":"https://api.github.com/users/duker33/gists{/gist_id}","starred_url":"https://api.github.com/users/duker33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duker33/subscriptions","organizations_url":"https://api.github.com/users/duker33/orgs","repos_url":"https://api.github.com/users/duker33/repos","events_url":"https://api.github.com/users/duker33/events{/privacy}","received_events_url":"https://api.github.com/users/duker33/received_events","type":"User","site_admin":false},"created_at":"2018-09-03T15:05:41Z","updated_at":"2018-09-03T15:05:41Z","author_association":"CONTRIBUTOR","body":"broke pdd rules here. So increase time. Wasted it for arch"}}
{"actor":{"display_login":"duker33"}}