The Open Event Server enables organizers to manage events from concerts to conferences and meetups. It offers features for events with several tracks and venues. It uses the JSON 1.0 Specification and build on top of Flask Rest Json API (for building Rest APIs) and Marshmallow (for Schema). In this blog, we will talk about how to add API for accessing and updating the Speaker Image Size on Open Event Server. The focus is on its API creation.
In this blog, we will talk about how to populate database for different event types and event topics in the Open Event Server.
Populating the Database
Using populate_db,py for populating the database.
Now, let’s try to understand this now.
- First of all, we will write two functions create_event_topics and create_event_types in populate_db.py .
- In these function we will make a list of all the event topics and event types which we want to populate in database.
- We will loop through these lists to create their objects if not present.
- Last step is to call these functions in populate and populate_without_print functions in populate_db.py itself.
Resources
- Documentation | Marshmallow : https://marshmallow-jsonapi.readthedocs.io/en/latest/
- Documentation | Flask Rest JSONAPI : http://flask-rest-jsonapi.readthedocs.io/en/latest/