feat: faker data: railway
This commit is contained in:
10
app.py
10
app.py
@@ -3,11 +3,13 @@ import config
|
||||
import utils.response as response
|
||||
import service.faker_data as faker
|
||||
from base import db
|
||||
from model import Person, SexEnum
|
||||
from model import Person, SexEnum, City
|
||||
|
||||
app = Flask(__name__)
|
||||
config.init_config(app)
|
||||
db.init_app(app)
|
||||
# with app.app_context():
|
||||
# print(db.session.query(City).one())
|
||||
|
||||
|
||||
@app.route('/')
|
||||
@@ -18,10 +20,10 @@ def hello_world(): # put application's code here
|
||||
|
||||
@app.route("/faker")
|
||||
def faker_data():
|
||||
persons = faker.store_faker_identification(1)
|
||||
results = [person.__to_dict__() for person in persons]
|
||||
# persons = faker.store_faker_identification(1)
|
||||
# results = [person.__to_dict__() for person in persons]
|
||||
# return response.succ(persons)
|
||||
return response.succ(faker.faker_train(3))
|
||||
return response.succ(faker.faker_railways(30))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user