Mvc-flask

Latest version: v2.9.0

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

Scan your dependencies

Page 3 of 3

2.3.1

2.3.0

2.2.0

2.1.0

You can use `Router.all()` to register all routes of `CRUD`.

python
Router.all("users")


The previous command produce this:

shell
users.create POST /users
users.delete DELETE /users/<id>
users.edit GET /users/<id>/edit
users.index GET /users
users.new GET /users/new
users.show GET /users/<id>
users.update PUT /users/<id>


You can also use `only parameter` to controll routes, e.g:

python
Router.all("messages", only="index show new create")


The previous command produce this:

shell
messages.create POST /messages
messages.index GET /messages
messages.new GET /messages/new
messages.show GET /messages/<id>


The paramenter `only` accept `string` or `array`, so, you can use `only=["index", "show", "new", "create"]`

2.0.0

This verion contain break change:

- Now the routes are be registered using `.py` file.
- To standardize the application the `mvc_flask` extension just work with app directory
- You can register routes based in methods: `GET`, `POST`, `UPDATE` and `DELETE`
- we no longer support to `routes.json` file.

To register routes you can use the `routes.py` inside `app directory` and the file must contain the import `Router` object, The Router object must be used to register the routes. You can use `GET`, `POST`, `UPDATE` and `DELETE` methods to register routes. E.g:

python
from mvc_flask import Router

Router.get("/", "homeindex")
Router.get("/hello", "homehello")
Router.post("/messages", "messagescreate")
Router.put("/users/<id>", "usersupdate")
Router.delete("/users/<id>", "usersdelete")

1.0.0

Page 3 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.