Skip to content

Commit

Permalink
Merge pull request #40 from Martlark/2.0.2
Browse files Browse the repository at this point in the history
2.0.2
  • Loading branch information
Martlark authored Aug 21, 2021
2 parents 5595959 + add5e30 commit 3f7111b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -682,9 +682,9 @@ Method Operation
====== ================================================================================================== ============================
GET returns one item when `item_id` is a primary key. {property1:value1,property2:value2,...}
GET returns all items when `item_id` is None. [{item1},{item2},...]
PUT updates item using `item_id` as the id from request json data. Calls the model `__fs_verify__` before {message:message,item:{model_fields,...},properties:{__fs_update_properties__}}
updating. Returns new item as {item}
DELETE removes the item with primary key of `item_id` if self.__fs_can_delete__ does not throw an error. {property1:value1,property2:value2,...}
PUT updates item using `item_id` as the id from request json data. Calls the model `__fs_verify__` {message:message,item:{model_fields,...},properties:{__fs_update_properties__}}
before updating. Returns new item as {item}
DELETE removes the item with primary key of `item_id` if self.__fs_can_delete__ does not throw an error. {property1:value1,property2:value2,...}
Returns the item removed. Calls `__fs_can_delete__` before delete.
POST creates and returns a Flask response with a new item as json from form body data or JSON body data {property1:value1,property2:value2,...}
when `item_id` is None. Calls the model `__fs_verify__` method before creating.
Expand Down Expand Up @@ -984,6 +984,7 @@ Version 2.0.1 changes most of the properties, hooks and methods to use a more no
Release Notes
-------------

* 2.0.2 - Fix table formatting.
* 2.0.1 - Try to get properties and methods to use more appropriate names.
* 1.5.2 - Test with flask 2.0. Add __fs_after_commit__ method to allow post create/update actions. Improve documentation.
* 1.5.1 - Fix TypeError: unsupported operand type(s) for +=: 'ImmutableColumnCollection' and 'list' with newer versions of SQLAlchemy
Expand Down
2 changes: 1 addition & 1 deletion flask_serialize/flask_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class FlaskSerializeMixin:
# previous values of an instance before update attempted
__fs_previous_field_value__ = {}
# current version
__fs_version__ = "2.0.1"
__fs_version__ = "2.0.2"

def __fs_before_update__(self, data_dict:dict) -> dict:
"""
Expand Down
4 changes: 2 additions & 2 deletions pypar.commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ pip install pytest-flask

. venv3/bin/activate
python setup.py sdist bdist_wheel
twine check dist/flask_serialize-2.0.1*
twine upload dist/flask_serialize-2.0.1* -u martlark
twine check dist/flask_serialize-2.0.2*
twine upload dist/flask_serialize-2.0.2* -u martlark
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ flask-wtf
setuptools
wheel
twine
restructuredtext_lint
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from codecs import open
from setuptools import setup

VERSION = "2.0.1"
VERSION = "2.0.2"
LONG_DESCRIPTION = open("README.rst", "r", encoding="utf-8").read()

setup(
Expand Down
9 changes: 9 additions & 0 deletions test/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,3 +812,12 @@ def test_user(client):
rv = client.post(f"/user_add_data/{user_id}", data={"data": test_value})
assert rv.json["name"] == user_name
assert test_value in [item.get('value') for item in rv.json["data_items"]]


def test_readme_list():
import restructuredtext_lint
errors = restructuredtext_lint.lint_file('../README.rst')
if len(errors):
for e in errors:
print('\nRST LINT FAILURE', e.message)
assert len(errors) == 0

0 comments on commit 3f7111b

Please sign in to comment.