Skip to content

Commit

Permalink
Updates docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtiesling committed Nov 26, 2023
1 parent 4aeb180 commit 32eeb5d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

name: ci
on:
push
# branches:
# - main
push:
branches:
- main
permissions:
contents: write
jobs:
Expand Down
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ class MyModel(db.Model):

class MyModelSchema(ma.Schema):
id = mf.Integer(dump_only=True)
name = mf.String(required=True)
name = mf.String()

class MyModelApiView(MuckApiView):
api_name = "my-model"
session = db.session
Model = MyModel
ResponseSchema = MyModel
CreateSchema = MyModel
PatchSchema = MyModel
UpdateSchema = MyModel
ResponseSchema = MyModelSchema
CreateSchema = MyModelSchema
PatchSchema = MyModelSchema
UpdateSchema = MyModelSchema
searchable_columns = [MyModel.name]

blueprint = Blueprint("api", __name__, url_prefix="/api/")
MyModelApiView.add_crud_to_blueprint(blueprint)

# Available Endpoint
# Available Endpoints:
# CREATE | curl -X POST "/api/v1/my-model" -H "Content-Type: application/json" \-d "{\"name\": \"Ayla\"}"
# LIST ALL | curl -X GET "/api/v1/my-model" -d "Accept: application/json"
# LIST ALL PAGINATED | curl -X GET "/api/v1/my-model?limit=100&offset=50" -d "Accept: application/json"
Expand All @@ -52,25 +52,32 @@ MyModelApiView.add_crud_to_blueprint(blueprint)
# DELETE | curl -X DELETE "/api/v1/my-model/1"
```

## Features
- Automatic generation of CRUD endpoints.
- Built-in search, filter, sort and pagination when listing resources.
- Support for APIs with nested resources (i.e. /api/classrooms/12345/students).
- Fully compatible with any other Flask method-based or class-based views. Mix & match with your existing views.
- Pre and post callbacks configurable on all manipulation endpoints. Allow for adding arbitrary logic before and after Create, Update or Delete operations.


## Install

Flask-Muck is in Beta and does not have a production available for install yet. A standard production release on PyPi
is coming soon.
Flask-Muck is in Beta and does not have a standard version available for install yet. A standard release on PyPi is coming soon.

`pip install flask-muck`

Flask-Muck supports Python >= 3.9

## Issues

Submit any issues you may encounter on [Github](https://github.com/dtiesling/flask-muck/issues). Please search for
Submit any issues you may encounter on [GitHub](https://github.com/dtiesling/flask-muck/issues). Please search for
similar issues before submitting a new one.

## Documentation

Refer to the [examples](./examples) directory for more information on usage and available features.

Full documentation is coming soon.
Full documentation is a work-in-progress but will be completed soon. It can be found [here](https://dtiesling.github.io/flask-muck/).

## License

Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ classifiers = [

[project.urls]
"Homepage" = "https://github.com/dtiesling/flask-muck"
"Repository" = "https://github.com/dtiesling/flask-muck"
"Documentation" = "https://dtiesling.github.io/flask-muck/"

[tool]
[tool.hatch.version]
Expand Down

0 comments on commit 32eeb5d

Please sign in to comment.