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

Filter without saving #108

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

alonraiz
Copy link
Contributor

Fixes #67
Fixes #81

@modlinltd modlinltd deleted a comment Oct 18, 2019
@coveralls
Copy link

coveralls commented Oct 18, 2019

Coverage Status

Coverage decreased (-3.0%) to 92.948% when pulling b695456 on alonraiz:just-filter-without-save into 142ecd0 on modlinltd:develop.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.6%) to 95.282% when pulling c4f539f on alonraiz:just-filter-without-save into ba51e69 on modlinltd:develop.

* filter without creating new object
* Fixed select2 widgets not initializing

* fixed bad placement of initialize_select2 call

* Changes URL declaration to avoid deprecated pattern

This commit changes the way the URLs are declared to avoid RemovedInDjango110Warning messages. The
old way, using django.conf.urls.patterns(), is deprecated and will be removed in Django 1.10
@modlinltd modlinltd deleted a comment Dec 8, 2019
@asfaltboy
Copy link
Member

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- advanced_filters/admin.py  2
         

See the complete overview on Codacy

@anhlt
Copy link

anhlt commented Jun 6, 2020

Any update on this pull request?

Copy link
Member

@asfaltboy asfaltboy left a comment

Choose a reason for hiding this comment

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

The tests have seemed to vanish since last I saw this feature PR... would be great to have them back

@@ -127,6 +127,17 @@ def test_create_form_valid(self):

assert list(created_filter.query.children[0]) == self.query

# just filter
Copy link
Member

Choose a reason for hiding this comment

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

This should go in it's own test, e.g test_create_form_valid_just_filter and I would rename test_create_form_valid_save_goto

b64_query = query_serializer.dumps(search_query)
url = "{path}?_aquery={query}"\
.format(path=request.path, query=b64_query)
return HttpResponseRedirect(url)
Copy link
Member

Choose a reason for hiding this comment

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

How about we add this into it's own method filter_without_saving or filter_ad_hoc or some other name, and allow it to be called from adv_filters_handle if not saving.


data['form-TOTAL_FORMS'] += 1

return data, False
Copy link
Member

Choose a reason for hiding this comment

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

The above means to initialize the forms when querying without saving? If so, perhaps we can use AdvancedFilterForm.initialize_form to make this more cleaner? Or is it impossible?

@TrangPham
Copy link
Contributor

When would this be included in a new version?

@asfaltboy
Copy link
Member

There are a couple of comments to address, I'd appreciate any help from contributors as I don't use on the project these days.

alonraiz and others added 2 commits May 16, 2021 12:01
* update README

remove confusion from the installation instruction

* test: refactor unittest test cases to pytest

* chore: replace deprecated assertEquals

* chore: replace deprecated logger.warn with warning

* style: correct small code style bugs

* chore: bump test dependencies

* use soft version for coveralls to support python 2.7
* use pycodestyle instead of older pep8
* bump to latest versions of factory-boy and pytest-django

* Update CI (#1)

* fixup! test: refactor unittest test cases to pytest

* fix: update requirements for new test deps matrix

* use tox-travis to keep the travis and tox requirements fairly clean
* drop versions <3.5 and add released 3.8
* use travis python config and specify pypy3.6
* allow any version of coveralls (easier support for python 2.7)
* add up to django 3.0 version according to official dep matrix:

Refs:
- https://www.djangoproject.com/download/#supported-versions
- https://docs.djangoproject.com/en/dev/faq/install/

* Django 3.0

fix modlinltd#110

* fix: switch deprecated force_text to force_str

* fix: avoid installing newer braces

due to hard requirement of Django 1.11, it's incompatible with our
wish to still support django versions 1.9 and 1.10

* fixup! test: refactor unittest test cases to pytest

* chore: update python and add Django classifiers

* docs: update dependencies stated in the README

+ update link to vtiger ref

* test: add a failing test_choices_has_null

required setting a string field to nullable in the Client test model

+ test that datetime field choices are being excluded

* fix: allow choices sort on None fields

; Conflicts:
;	advanced_filters/views.py

* add release workflow

* test: test the CleanWhiteSpacesMixin helper

* chore: update changelog and bump version to 1.2.0

* docs: fix typo and clarify title

Switching to using the python publish github action which uses
twine to push source and wheel to pypi whenever a release is created
in GitHub

* fix: correct travis.yml deprecated/dupe keywords

* Update django-braces

* import FieldDoesNotExist from django.core.exceptions

* fix: update test matrix to include Django 3.1

Ref: https://docs.djangoproject.com/en/3.1/faq/install/

* chore(setup.py): add Django 3.1 to classifiers

+ sort imports

* Add Turkish translation

* Update Admin to show model

* Add support for python 3.9 and django 3.1

* chore: update changelog and bump version to 1.3.0

Co-authored-by: Pavel Savchenko <[email protected]>
Co-authored-by: Arpit <[email protected]>
Co-authored-by: Petr Dlouhý <[email protected]>
Co-authored-by: Hugo Maingonnat <[email protected]>
Co-authored-by: João Batista <[email protected]>
Co-authored-by: predatell <[email protected]>
Co-authored-by: Özcan YARIMDÜNYA <[email protected]>
Co-authored-by: Thu Trang Pham <[email protected]>
@arthurbarros
Copy link

Is this going to get merged anytime soon ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Temporary filters Option to execute filter without saving/titling it?
6 participants