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

Add autocomplete_fields in Admin and other updates #100

Closed
wants to merge 9 commits into from

Conversation

anuj9196
Copy link

The update include

  • Add autocomplete_fields to foreign key fields to enable select2 ajax searchable foreign key field. This will reduce queries and optimize admin page when related objects are large in the count.
  • Add PricingAdmin. Required to add search_fields to add in autocomplete_fields.
  • Add list_filters. Add a few possible fields to the list_filters list.
  • Update verbose name. Updated verbose names of name, available, visible fields of Plan model to improve visibility in the filter list.
  • Add visible field to the Pricing model. Sometimes admin wants to hide a few pricing but can not delete it as there might be existing users under this pricing.

anuj9196 added 6 commits May 29, 2019 15:02
Add autocomplete_fields to have select2 input for foreign key fields. This optimizes admin and reduces queries and speed when related objects are a lot to fetch.
There may be chances when the admin wants to hide few pricing levels from pricing model visible to the user but does not want to delete as there may be existing users under this pricing.
add pricing admin with searchable fields to be used in autocomplete_fields
This will fix visibility in admin panel filter list
@codecov-io
Copy link

codecov-io commented May 29, 2019

Codecov Report

Merging #100 into master will increase coverage by 0.22%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #100      +/-   ##
==========================================
+ Coverage   76.41%   76.64%   +0.22%     
==========================================
  Files          36       37       +1     
  Lines        1819     1841      +22     
==========================================
+ Hits         1390     1411      +21     
- Misses        429      430       +1
Impacted Files Coverage Δ
plans/enum.py 80.55% <ø> (-1.8%) ⬇️
plans/migrations/0005_auto_20190529_1055.py 100% <100%> (ø)
plans/admin.py 77.5% <100%> (+2.97%) ⬆️
plans/models.py 82.47% <100%> (+0.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6897fcb...3a04e3b. Read the comment docs.

anuj9196 added 2 commits May 29, 2019 16:23
Some users may have recurring based order and the user will be able to disable recurring. This flag will add a check whether the order is recurring based or not.
Add migrations file
Get display id using string status code.
```
Order.STATUS.get_display_id('NEW')
```
@Alir3z4
Copy link
Collaborator

Alir3z4 commented Sep 7, 2019

Thanks for the patch,

However some stuff are missing:

  • Updating changelog.
  • Add more unit tests and use case of the the fields added in this patch.

@Alir3z4
Copy link
Collaborator

Alir3z4 commented Sep 7, 2019

Would like to know what @PetrDlouhy thinks of this changes as well.

@PetrDlouhy
Copy link
Collaborator

Hi, I looked at this, but didn't test.

  • When the autocomplete_fields are added, the raw_only_fields have no effect and should be removed.
  • What does the is_recurring field do? Is first step in implemementation of recurring payments? It is very much appreciated functionality, but should be posted under separate PR.

@Alir3z4 Alir3z4 closed this Oct 11, 2021
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.

4 participants