mirror of
https://github.com/jeffknupp/sandman2.git
synced 2026-04-25 08:35:49 +03:00
[PR #124] [CLOSED] General Refactoring #156
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
pull-request
question
refactoring
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/sandman2-jeffknupp#156
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jeffknupp/sandman2/pull/124
Author: @Carelvd
Created: 9/18/2019
Status: ❌ Closed
Base:
master← Head:master📝 Commits (10+)
0acd441Renamed the main package3754fdeException registration moved1b4ea99Database4cd2c1fAdministration806646aMoved service registratione17fc70Moved model registrationc7332ffCleaned up the application factorycca3c2eCleaned up the apid903fcfNeatened up the APIcf4f799Modified the application function📊 Changes
38 files changed (+531 additions, -402 deletions)
View changed files
📝
.travis.yml(+1 -1)📝
dockerfiles/start.sh(+1 -1)📝
docs/conf.py(+6 -6)➕
docs/errors.rst(+11 -0)📝
examples/example_automap.py(+2 -2)📝
examples/example_user_models.py(+2 -2)📝
examples/user_models.py(+1 -1)➕
flask_sandman/__init__.py(+5 -0)➕
flask_sandman/__main__.py(+68 -0)➕
flask_sandman/admin.py(+36 -0)➕
flask_sandman/api.py(+50 -0)➕
flask_sandman/app.py(+47 -0)➕
flask_sandman/database.py(+12 -0)📝
flask_sandman/decorators.py(+3 -5)📝
flask_sandman/exception.py(+46 -14)📝
flask_sandman/model.py(+79 -17)📝
flask_sandman/service.py(+98 -44)📝
flask_sandman/templates/admin/index.html(+0 -0)📝
flask_sandman/templates/create.html(+0 -0)📝
flask_sandman/templates/edit.html(+0 -0)...and 18 more files
📄 Description
Dear Mr. Knupp,
I was hoping to make this PR against a
developmentbranch in your repository but it seems that Github does not allow for this and forces one to push to an existing branch, so I went with the master branch again, I trust this is fine with you.I have tried to follow the Flask Extension/Pallets Project guidelines with this PR. The major changes are as follows :
app.pyinto their "parent" modules e.g.register_serviceis now theregisterfunction inservice.py, similarly there are register functions inmodel.py,views.py,exception.pyandadmin.py.flask_sandman.app:applicationintoflask_sandman.api:sandmanso that there is a central function any user of the library can invoke within their owncreate_appmethods. I have also refactored this into aSandmanclass akin toSQLAlchemyorApifrom flask restful but it's rough and omitted from this PR._register_user_modelsand_reflect_allintoflask_sandman.api:sandmanremoving the need for thereflect_allflag. This was a touch more intricate then I initially realized.flask_sandman.app:applicationthere is a "router" variable this is assigned either the application or, if one is provided, a blueprint. I am developing an application against this feature and haven't had any trouble when using a blueprint so far. I haven't had the chance to port my experiences to uni test in Sandman just yet though.Sandman2toflask_sandman.get_apptocreate_app; internally this is calledapplicationbut it is exposed to the user ascreate_appe.g.from flask_sandman import create_app.I have also done some work on the documentation. This is still a bit rough though and I thought it best to make another PR's if this one is accepted.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.