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

Move part of catalog.newcontext.products classes to QuerySet #255

Closed
duker33 opened this issue Feb 8, 2019 · 6 comments
Closed

Move part of catalog.newcontext.products classes to QuerySet #255

duker33 opened this issue Feb 8, 2019 · 6 comments
Assignees
Labels
1 hour typical issue size. It's one pdd hour. Performer should spend about one astronomical hour for this i 2 performer can implement issue at his closest convenient time Context feature x2

Comments

@duker33
Copy link
Collaborator

duker33 commented Feb 8, 2019

This set of classes are not contexts. They don't have their own context data, but have only QuerySet logic.
Later we discussed this module using at site with the architect. And Artemiy said, that this classes are semantically separated from others in this module
fidals/shopelectro#689 (comment)

If we'll move it's logic to QuerySets, we'll make this semantic more clear.

ActiveProducts
OrderedProducts
PaginatedProducts
ProductsByCategory
TaggedProducts
@duker33 duker33 added discuss issue needs to finish discussion before start working 1 hour typical issue size. It's one pdd hour. Performer should spend about one astronomical hour for this i 2 performer can implement issue at his closest convenient time Context feature labels Feb 8, 2019
@duker33
Copy link
Collaborator Author

duker33 commented Feb 8, 2019

@artemiy312 , what do you think about this proposal?

@ArtemijRodionov
Copy link
Contributor

Yes, we can do it. It looks like the django-way approach.
Unfortunately it will lead to giant and imperative QuerySet classes, but it seems unavoidable when working with ORM and django

Also we can remove some tags context classes in favor of QuerySet methods.
PaginatedProducts we should leave, because it isn't working only with QuerySet.

As the result only PaginatedProducts, ProductImages, ProductBrands, GroupedTags will remain.

@duker33
Copy link
Collaborator Author

duker33 commented Feb 8, 2019

@artemiy312 , we can organise this code in a right way. It'll take not more space, then it taken in contexts now.

PaginatedProducts does this two things:

  • just forwards refarm_pagination.context.PaginationContext class for context data.
  • uses the class for queryset processing refarm_pagination.context.PaginationContext

Despite this two operations uses the same class, they are separated semantically. So, we can split them: the first peace we just throw away. The second one goes to queryset.

So, i'll propose some code

@duker33 duker33 self-assigned this Feb 8, 2019
@duker33 duker33 removed the discuss issue needs to finish discussion before start working label Feb 8, 2019
@duker33
Copy link
Collaborator Author

duker33 commented Feb 12, 2019

i'll adapt SE to the new refarm's code in the same task

@duker33 duker33 added the x2 label Feb 12, 2019
duker33 added a commit that referenced this issue Feb 12, 2019
duker33 added a commit that referenced this issue Feb 14, 2019
* #255  PDD task to fix bad settings entry

* #255  Move part of products context to the qs

* rf#255  Remove redundant tests

* #240  Fix CI
@0pdd
Copy link
Collaborator

0pdd commented Feb 14, 2019

@duker33 the puzzle #266 is still not solved.

@0pdd
Copy link
Collaborator

0pdd commented Mar 15, 2019

@duker33 the puzzle #308 is still not solved; solved: #266.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 hour typical issue size. It's one pdd hour. Performer should spend about one astronomical hour for this i 2 performer can implement issue at his closest convenient time Context feature x2
Projects
None yet
Development

No branches or pull requests

3 participants