wtg / shuttletracker

🚐 Shuttle tracking for RPI.
https://shuttles.rpi.edu
GNU Affero General Public License v3.0
46 stars 53 forks source link

Import stops and vehicles from JSON #318

Closed MattCzyr closed 3 years ago

MattCzyr commented 3 years ago
Do not merge until tested

What is changed/New?

Stops and vehicles can now be imported from JSON files through the admin panel, in the same way that routes could already be.

How was this accomplished?

Added a file chooser to the stops and vehicles admin panel tabs that parses objects and inserts them into the database when a file is submitted.

Is This Related to An Issue? (link if applicable):

N/A

Additional Notes:

When stops are imported, they use the stop IDs from the JSON file rather than relying on the auto-incrementing serial column, so that they are associated with the correct routes.