Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rf#197 Rm prepare_data from context #627

Merged
merged 6 commits into from
Nov 7, 2018
Merged

Conversation

duker33
Copy link
Contributor

@duker33 duker33 commented Nov 2, 2018

... and customize images context

Depends on fidals/refarm-site#206

fidals/refarm-site#197
fidals/refarm-site#198

'product_images': context_.get_context_data()['product_images'],
'product_brands': context_.get_context_data()['product_brands'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'product_brands': context_.get_context_data()['product_brands'],
products_ctx = context_.get_context_data()
...
'product_images': products_ctx['product_images'],
'product_brands': products_ctx['product_brands'],

class ProductImages(AbstractProductsListContext):

@property
def images(self) -> typing.Dict[int, Image]:
Copy link
Contributor

@ArtemijRodionov ArtemijRodionov Nov 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is better to be a method, because it perform heavily computations

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@artemiy312 , we already have tags, products, product_pages in the same property-style.
Let's leave as is too keep it's style. And fidals/refarm-site#194 with it's subtasks will solve this problem too

@duker33 duker33 merged commit 3e123b9 into master Nov 7, 2018
@duker33 duker33 deleted the rf197_rm_prepare_data branch November 7, 2018 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants