Skip to content

Administration Panel

Hayden Carpenter edited this page Dec 7, 2020 · 2 revisions

Administration Panel

Administration of the site can be found at https://frc4026.com/admin/.
Users with the staff status should be able to view the page, and users with superuser status should be able to make changes.
If you do not have such a status, ask someone with the status for help.

Scoutingtool

The Scoutingtool section of the admin panel is what you should be mostly using. This is where you can see and edit the data created from the models in models.py. When a form is submitted, the data will be shown here.

If you are editing models.py, and you are getting errors when you are trying to view this page, that might be because you did not properly define a string form of the model. See the models page for more information.

Picking the current event

Current scouting should have one item. That is the event you are currently creating data for, and stats are based off of. If you need to switch events, do so here.

Creating a new event

Events are the current events that we are creating data for. Create a new event with the name that the blue alliance id that corresponds to it. This can be found on https://thebluealliance.com in the url for the event. For example, https://www.thebluealliance.com/event/2019gacmp would be entered into the database as 2019gacmp.

Matches

"Matchs" (Django automatically just adds an s to the model name, and as a result the set of Match objects is called "Matchs", not "Matches") is the table that contains automatically generated matches for each event. This is done through TheBlueAlliance's API. You probably do not want to edit this one.

Reports

Reports contains all of the scouting reports submitted to the website. This will probably be what you end up editing the most.
It is perfectly fine to delete objects in this table if they are wrong, or edit them.

Schedules

This is also autogenerated.
Each scouter is assigned a JSON object with their schedule. This JSON is interpreted on both the schedule and scoutingform views through <script> tags.
TODO: Add a method of generating scouting schedules and picking users in the admin panel.

Teams

Autogenerated Teams list. Same as the Matches. You probably don't want to edit this one.

Adding new models to the admin panel

If you want to add a new model to the panel, you can do so in the admin.py file in the scoutingtool folder.

from django.contrib import admin

from .models import *

admin.site.register(Report)
admin.site.register(Match)
admin.site.register(Team)
admin.site.register(CurrentScouting)
admin.site.register(Schedule)
admin.site.register(Event)
...
admin.site.register(Model)

OAuth

If you, god forbid, have to change OAuth settings (maybe add a new provider?) do so in the settings.py file. More information can be found on the Django settings section.

Clone this wiki locally