model
This commit is contained in:
+2
-4
@@ -2,7 +2,6 @@ import datetime
|
||||
|
||||
from entrance.extensions import db
|
||||
from sqlalchemy.orm import relationship
|
||||
from sqlalchemy import Table
|
||||
from sqlalchemy import ForeignKey
|
||||
from sqlalchemy.orm import backref
|
||||
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema
|
||||
@@ -38,7 +37,7 @@ class CurdModel(BaseModel):
|
||||
|
||||
|
||||
Column = db.Column
|
||||
Table = Table
|
||||
Table = db.Table
|
||||
relationship = relationship
|
||||
ForeignKey = ForeignKey
|
||||
backref = backref
|
||||
@@ -87,5 +86,4 @@ Enum = db.Enum
|
||||
ARRAY = db.ARRAY
|
||||
JSON = db.JSON
|
||||
|
||||
|
||||
SQLAlchemyAutoSchema=SQLAlchemyAutoSchema
|
||||
SQLAlchemyAutoSchema = SQLAlchemyAutoSchema
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from flask_mail import Message
|
||||
|
||||
from applications.extensions.init_mail import mail
|
||||
|
||||
|
||||
# send_mail(subject='title', recipients=['123@qq.com'], content='body')
|
||||
from entrance.extend.mail import mail
|
||||
|
||||
|
||||
def send_mail(subject, recipients, content):
|
||||
try:
|
||||
message = Message(subject=subject, recipients=recipients, body=content)
|
||||
|
||||
+11
-23
@@ -4,35 +4,22 @@ from flask.views import MethodViewType, MethodView
|
||||
|
||||
class Blueprint(FlaskBlueprint):
|
||||
|
||||
# Order in which the methods are presented in the spec
|
||||
HTTP_METHODS = ["OPTIONS", "HEAD", "GET", "POST", "PUT", "PATCH", "DELETE"]
|
||||
|
||||
DEFAULT_LOCATION_CONTENT_TYPE_MAPPING = {
|
||||
"json": "application/json",
|
||||
"form": "application/x-www-form-urlencoded",
|
||||
"files": "multipart/form-data",
|
||||
}
|
||||
|
||||
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
self.description = kwargs.pop("description", "")
|
||||
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
self._endpoints = []
|
||||
|
||||
def add_url_rule(
|
||||
self,
|
||||
rule,
|
||||
endpoint=None,
|
||||
view_func=None,
|
||||
provide_automatic_options=None,
|
||||
*,
|
||||
parameters=None,
|
||||
tags=None,
|
||||
**options,
|
||||
self,
|
||||
rule,
|
||||
endpoint=None,
|
||||
view_func=None,
|
||||
provide_automatic_options=None,
|
||||
*,
|
||||
parameters=None,
|
||||
tags=None,
|
||||
**options,
|
||||
):
|
||||
|
||||
if view_func is None:
|
||||
@@ -75,5 +62,6 @@ class Blueprint(FlaskBlueprint):
|
||||
for bp in bp_lists:
|
||||
self.register_blueprint(bp)
|
||||
|
||||
|
||||
class View(MethodView):
|
||||
pass
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user