This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from arrested import Resource | |
from arrested.contrib.kim_arrested import KimEndpoint | |
from arrested.contrib.sql_alchemy import DBListMixin, DBObjectMixin, DBCreateMixin | |
from star_wars.models import db, Character, UserCharacterLike | |
from .mappers import CharacterMapper, UserCharacterLikeMapper | |
characters_resource = Resource('characters', __name__, url_prefix='/characters') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy_utils import EmailType, PasswordType | |
from .base import db, BaseMixin | |
class User(BaseMixin, db.Model): | |
__tablename__ = 'users' | |
name = db.Column(db.Unicode(255), nullable=False) | |
email = db.Column(EmailType, nullable=False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy_utils import EmailType, PasswordType | |
from .base import db, BaseMixin | |
class User(BaseMixin, db.Model): | |
__tablename__ = 'users' | |
name = db.Column(db.Unicode(255), nullable=False) | |
email = db.Column(EmailType, nullable=False) | |
password = db.Column(PasswordType( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .client import * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shortuuid | |
import uuid | |
from .base import db, BaseMixin | |
class Client(BaseMixin, db.Model): | |
__tablename__ = 'api_client' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from arrested import Resource | |
from arrested.contrib.kim_arrested import KimEndpoint | |
from arrested.contrib.sql_alchemy import DBListMixin, DBCreateMixin, DBObjectMixin | |
from star_wars.models import db, Character | |
from .mappers import CharacterMapper | |
characters_resource = Resource('characters', __name__, url_prefix='/characters') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from arrested import Resource | |
from arrested.contrib.kim_arrested import KimEndpoint | |
from arrested.contrib.sql_alchemy import DBListMixin, DBCreateMixin | |
from star_wars.models import db, Character | |
from .mappers import CharacterMapper | |
characters_resource = Resource('characters', __name__, url_prefix='/characters') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from arrested import ArrestedAPI | |
from .users import users_resource | |
from .characters import characters_resource | |
from .middleware import basic_auth | |
api_v1 = ArrestedAPI(url_prefix='/v1', before_all_hooks=[basic_auth]) | |
api_v1.register_resource(users_resource, defer=True) | |
api_v1.register_resource(characters_resource, defer=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from arrested import Resource | |
from arrested.contrib.kim_arrested import KimEndpoint | |
from arrested.contrib.sql_alchemy import DBListMixin | |
from star_wars.models import db, Character | |
from .mappers import CharacterMapper | |
characters_resource = Resource('characters', __name__, url_prefix='/characters') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .user import UserMapper | |
from .character import CharacterMapper |