Tested and added release process to readme, also some minor changes to change confirm
parent
d334ec630f
commit
c381eb4b87
3
Makefile
3
Makefile
|
|
@ -24,3 +24,6 @@ upload-testpypi:
|
||||||
|
|
||||||
i-have-tested-with-testpypi-and-am-ready-to-release:
|
i-have-tested-with-testpypi-and-am-ready-to-release:
|
||||||
python3 -m twine upload --repository pypi dist/django_admin_confirm-$(VERSION)*
|
python3 -m twine upload --repository pypi dist/django_admin_confirm-$(VERSION)*
|
||||||
|
|
||||||
|
install-testpypi:
|
||||||
|
python -m pip install --index-url https://test.pypi.org/simple/ django_admin_confirm
|
||||||
|
|
|
||||||
36
README.md
36
README.md
|
|
@ -165,6 +165,42 @@ pip install -e .
|
||||||
make run
|
make run
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Release process
|
||||||
|
|
||||||
|
Honestly this part is just for my reference. But who knows :) maybe we'll have another maintainer in the future.
|
||||||
|
|
||||||
|
Run tests, check coverage, check readme, run tox
|
||||||
|
|
||||||
|
```
|
||||||
|
make test
|
||||||
|
make check-readme
|
||||||
|
tox
|
||||||
|
```
|
||||||
|
|
||||||
|
Update version in `setup.py`
|
||||||
|
|
||||||
|
```
|
||||||
|
make package
|
||||||
|
make upload-testpypi
|
||||||
|
```
|
||||||
|
|
||||||
|
Install new version locally
|
||||||
|
First you have to uninstall if you used `pip install -e` earlier
|
||||||
|
|
||||||
|
```
|
||||||
|
pip uninstall django_admin_confirm
|
||||||
|
make install-testpypi
|
||||||
|
```
|
||||||
|
|
||||||
|
Update version in `requirements.txt`
|
||||||
|
Add test locally
|
||||||
|
|
||||||
|
```
|
||||||
|
make run
|
||||||
|
```
|
||||||
|
|
||||||
|
Go on github and make a release in UI
|
||||||
|
|
||||||
## Feature List
|
## Feature List
|
||||||
|
|
||||||
This is a list of features which could potentially be added in the future. Some of which might make more sense in their own package.
|
This is a list of features which could potentially be added in the future. Some of which might make more sense in their own package.
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,9 @@ class AdminConfirmMixin:
|
||||||
else:
|
else:
|
||||||
# Parse the changed data - Note that using form.changed_data would not work because initial is not set
|
# Parse the changed data - Note that using form.changed_data would not work because initial is not set
|
||||||
for name, field in form.fields.items():
|
for name, field in form.fields.items():
|
||||||
|
# Since the form considers initial as the value first shown in the form
|
||||||
|
# It could be incorrect when user hits save, and then hits "No, go back to edit"
|
||||||
|
obj.refresh_from_db()
|
||||||
initial_value = getattr(obj, name)
|
initial_value = getattr(obj, name)
|
||||||
new_value = getattr(new_object, name)
|
new_value = getattr(new_object, name)
|
||||||
if (
|
if (
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
Django>=1.7.0
|
Django>=1.7.0
|
||||||
factory-boy~=3.0.1
|
factory-boy~=3.0.1
|
||||||
django-admin-confirm~=0.2.1
|
django-admin-confirm~=0.2.2
|
||||||
coverage~=5.4
|
coverage~=5.4
|
||||||
pytest~=6.2.2
|
pytest~=6.2.2
|
||||||
tox~=3.21.4
|
tox~=3.21.4
|
||||||
|
|
|
||||||
2
setup.py
2
setup.py
|
|
@ -6,7 +6,7 @@ README = open(os.path.join(here, "README.md")).read()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="django-admin-confirm",
|
name="django-admin-confirm",
|
||||||
version="0.2.1",
|
version="0.2.2",
|
||||||
packages=["admin_confirm"],
|
packages=["admin_confirm"],
|
||||||
description="Adds confirmation to Django Admin changes, additions and actions",
|
description="Adds confirmation to Django Admin changes, additions and actions",
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue