Skip to content

Commit 8b4f9b2

Browse files
authored
Merge pull request #36 from mekanix/feature/schemas
Project bootstrap
2 parents b0b6e4a + e1f8cd5 commit 8b4f9b2

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

bin/freenit.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,15 @@ if [ -z "${NAME}" ]; then
88
fi
99

1010

11-
MODULES="schemas"
1211
PROJECT_ROOT=`python${PY_VERSION} -c 'import os; import freenit; print(os.path.dirname(os.path.abspath(freenit.__file__)))'`
1312

1413

1514
mkdir ${NAME}
16-
for module in ${MODULES}; do
17-
mkdir -p ${NAME}/${module}
18-
touch ${NAME}/${module}/__init__.py
19-
done
2015
touch ${NAME}/__init__.py
2116
echo 'freenit' >requirements.txt
2217
cp -r ${PROJECT_ROOT}/project/* .
2318
mv api ${NAME}
2419
mv models ${NAME}
20+
mv schemas ${NAME}
2521
echo "app_name=\"${NAME}\" # noqa: E225" >name.py
2622
echo "ipdb" >requirements_dev.txt

freenit/project/schemas/__init__.py

Whitespace-only changes.

freenit/project/schemas/role.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from freenit.schemas.role import RoleSchema as BaseRoleSchema
2+
3+
4+
class RoleSchema(BaseRoleSchema):
5+
pass

freenit/project/schemas/user.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from freenit.schemas.user import BaseUserSchema
2+
3+
4+
class UserSchema(BaseUserSchema):
5+
pass

freenit/project/wsgi.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
api = import_module(f'{app_name}.api')
1111
config_name = os.getenv('FLASK_ENV') or 'default'
1212
config = configs[config_name]
13-
schemas = {
14-
'user': f'{app_name}.schemas.user',
15-
}
16-
app = create_app(config, schemas=schemas)
13+
app = create_app(config)
1714
api.create_api(app)
1815
hostname = socket.gethostname()
1916
port = os.environ.get('FLASK_PORT', 5000)

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name='freenit',
12-
version='0.0.25',
12+
version='0.0.26',
1313
description='REST API framework based on Flask-Smorest',
1414
long_description=README,
1515
long_description_content_type='text/markdown',
@@ -58,6 +58,7 @@
5858
'project/bin/*',
5959
'project/api/*',
6060
'project/models/*',
61+
'project/schemas/*',
6162
]
6263
},
6364
scripts=['bin/freenit.sh'],

0 commit comments

Comments
 (0)