Mvc-flask

Latest version: v2.9.0

Safety actively analyzes 682334 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

2.9.0

What's Changed
* Create support for calling callbacks on specific actions by marcuxyz in https://github.com/marcuxyz/mvc-flask/pull/56

Previously you could only run callbacks for all routes. For example,

**Before:**

python
from flask import render_template

before_request = ["set_user"]

def index(self):
return render_template('users/index.html', user=self.user)

def show(self):
return render_template('users/show.html', user=self.user)

def set_user(self):
self.user = 'Joe'


To both routes `index` and `show` you can call `self.user`.

Now, you can use dict structure to control the `before_request` callback.

python
before_request = dict(callback="set_user", actions="show")


See:

python
from flask import render_template

before_request = dict(callback="set_user", actions="show")

def index(self):
self.user is not implemented here
return render_template('users/index.html')

def show(self):
return render_template('users/show.html', user=self.user)

def set_user(self):
self.user = 'Joe'


Now you can invoke the callback only on the action of your choice


**Full Changelog**: https://github.com/marcuxyz/mvc-flask/compare/v2.8.3...v2.9.0

2.8.3

What's Changed
* Refactor main code, separate code into modules by marcuxyz in https://github.com/marcuxyz/mvc-flask/pull/55


**Full Changelog**: https://github.com/marcuxyz/mvc-flask/compare/v2.8.2...v2.8.3

2.8.2

What's Changed
* Improve code readability and maintainability in FlaskMVC class and Hook class by marcuxyz in https://github.com/marcuxyz/mvc-flask/pull/52
* bump version from 2.8.1 to 2.8.2 in __version__.py, pyproject.toml, and version_test.py by marcuxyz in https://github.com/marcuxyz/mvc-flask/pull/53


**Full Changelog**: https://github.com/marcuxyz/mvc-flask/compare/v2.8.1...v2.8.2

2.8.1

What's Changed
* Implement method tag for creating input hidden with PUT or DELETE value by marcuxyz in https://github.com/marcuxyz/mvc-flask/pull/48


**Full Changelog**: https://github.com/marcuxyz/mvc-flask/compare/v2.7.2...v2.8.1

2.7.2

What's Changed
* chore(pyproject.toml): update Flask to 3.0.0 by marcuxyz in https://github.com/marcuxyz/mvc-flask/pull/46


**Full Changelog**: https://github.com/marcuxyz/mvc-flask/compare/v2.7.1...v2.7.2

2.7.1

What's Changed
* Create a documentation for MVC-Flask by marcuxyz in https://github.com/marcuxyz/mvc-flask/pull/39
* Refactor the code, create documentation to code, and update tests by marcuxyz in https://github.com/marcuxyz/mvc-flask/pull/43

Description

**Test Improvements and Refactoring:**
New test cases were added to validate the registration of blueprints, routes, endpoints, and HTTP verbs​​.
The tests in routes_test.py were refactored for better readability and maintainability. This included removing unused properties and simplifying tests by directly comparing expected and actual blueprints, routes, and methods​​.

**Version Update and Tests:**
The package version was updated from 2.5.0 to 2.7.0, with a corresponding unit test added to verify this change​​.

**Test Setup and File Management:**
A conftest.py file was added for test fixtures and client setup, replacing the fixtures.py file. Additionally, the messages_endpoint_test.py file was added for testing message endpoints, while the request_test.py file was removed​​.

Makefile and Dependency Updates:
The Makefile was updated to use pytest instead of ward and to change the line length limit to 89 characters for consistency. Flask-SQLAlchemy and pytest were added as dev dependencies​​.

**Router Class Addition:**
A Router class was added to manage different HTTP routes (GET, POST, PUT, DELETE) for the application's controllers and actions​​.

**Additional Test Cases and Cleanup:**
New tests were added for checking blueprints registration, message routes, and endpoints. Unnecessary blank lines were removed to improve code readability. Tests were also added to ensure proper registration of routes and methods count​​​​​​.

**HTTP Method Override Functionality:**
The http_method_override.py file was added to handle HTTP method override functionality with new HTTPMethodOverrideMiddleware and CustomRequest classes​​.

**Controller and Route Management:**
The messages_controller.py was refactored to handle both JSON and form data for updating message titles. Unused methods and files in the controllers were removed, and new methods were added to improve code organization and readability​​​​.

**Full Changelog**: https://github.com/marcuxyz/mvc-flask/compare/v2.7.0...v2.7.1

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.