Skip to content
This repository has been archived by the owner on Feb 23, 2020. It is now read-only.

admin.py:244-245: Determine relevance of... #591

Closed
0pdd opened this issue Apr 11, 2019 · 6 comments · Fixed by #608
Closed

admin.py:244-245: Determine relevance of... #591

0pdd opened this issue Apr 11, 2019 · 6 comments · Fixed by #608
Assignees
Labels
1 burning issue 30 mins small issues. Usually cosmetic fixes Admin renew adapt admin to the options, tag and db templates integration cleanup everything that do project stronger, flexible, reusable x2 task's price doubled. Usually because of burning

Comments

@0pdd
Copy link
Collaborator

0pdd commented Apr 11, 2019

The puzzle 433-a94ade77 from #433 has to be resolved:

# @todo #433:30m Determine relevance of CharacteristicsEqualityFilter.
# Either drop in case of obsoleteness or integrate with new Option model.

The puzzle was created by Artemiy on 11-Apr-19.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

@0pdd
Copy link
Collaborator Author

0pdd commented Apr 11, 2019

@artemiyds2 @duker33 please pay attention to this new issue.

0pdd referenced this issue Apr 11, 2019
* Adopt admin for new Options

* Resurrect test_products_change_fieldset

* Fix admin filter tests

* Apply linter rules
@ArtemijRodionov ArtemijRodionov self-assigned this Apr 11, 2019
@ArtemijRodionov ArtemijRodionov added 1 burning issue 30 mins small issues. Usually cosmetic fixes cleanup everything that do project stronger, flexible, reusable labels Apr 11, 2019
@duker33 duker33 added the Admin renew adapt admin to the options, tag and db templates integration label Apr 12, 2019
@ArtemijRodionov
Copy link
Contributor

CharacteristicsEqualityFilter finds duplicated options by h1 or all fields. It still maybe helpful for content managers, so we should adopt it for Option model.

@duker33 Should we?

@duker33
Copy link
Contributor

duker33 commented Apr 15, 2019

@artemiy312 , it depends on DB content: if we have at least one duplicated mark for any pair of Options, we should implement it. Otherwise not.

Explore plz this fact. If it's true, create subtask for Options implementation

@ArtemijRodionov
Copy link
Contributor

In [1]: from django.db.models import Count

In [2]: from stroyprombeton.models import Option as O

In [3]: O.objects.values('mark').annotate(mark_count=Count('mark')).filter(mark_count__gt=1)
Out[3]: <OptionQuerySet [{'mark': 'Б-13', 'mark_count': 2}, {'mark': 'Ф6.201', 'mark_count': 2}, {'mark': 'ШЛП40п-9', 'mark_count': 3}, {'mark': '300ФП-1', 'mark_count': 2}, {'mark': 'РОП6.26-60', 'mark_count': 2}, {'mark': 'П-1-858', 'mark_count': 2}, {'mark': 'Ф5', 'mark_count': 5}, {'mark': '90Ш-1', 'mark_count': 2}, {'mark': 'ШТВ80.5', 'mark_count': 3}, {'mark': 'К15-3', 'mark_count': 2}, {'mark': '50СП-7в', 'mark_count': 4}, {'mark': 'Т6-4', 'mark_count': 2}, {'mark': 'Б-1а', 'mark_count': 2}, {'mark': 'ШТВ160.6', 'mark_count': 4}, {'mark': '50СП-7', 'mark_count': 2}, {'mark': 'Ф7.403', 'mark_count': 2}, {'mark': '9КФ175-1', 'mark_count': 2}, {'mark': 'К-3', 'mark_count': 2}, {'mark': 'К1-5', 'mark_count': 2}, {'mark': 'ТБ-1', 'mark_count': 2}, '...(remaining elements truncated)...']>

In [28]: O.objects.values('mark').annotate(mark_count=Count('mark')).filter(mark_count__gt=1).count()
Out[28]: 471

@ArtemijRodionov
Copy link
Contributor

We have duplicated marks.
I'll adopt this filter in the issue, so i'll increase the estimate

@ArtemijRodionov ArtemijRodionov added the x2 task's price doubled. Usually because of burning label Apr 16, 2019
ArtemijRodionov added a commit that referenced this issue Apr 17, 2019
* Adopt duplicate filter for Option model

* Review fixes

* Format a todo
@0pdd
Copy link
Collaborator Author

0pdd commented Apr 17, 2019

@0pdd the puzzle #615 is still not solved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 burning issue 30 mins small issues. Usually cosmetic fixes Admin renew adapt admin to the options, tag and db templates integration cleanup everything that do project stronger, flexible, reusable x2 task's price doubled. Usually because of burning
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants