Skip to content

Commit

Permalink
Merge pull request #42 from nfoert/development
Browse files Browse the repository at this point in the history
v0.0.5-alpha
  • Loading branch information
nfoert authored Jan 5, 2025
2 parents 2150e41 + c7cc0c0 commit 519381f
Show file tree
Hide file tree
Showing 16 changed files with 540 additions and 79 deletions.
3 changes: 2 additions & 1 deletion .env-template
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ DEBUG=on
DATABASE_URL=sqlite:///db.sqlite3
ADMIN_PATH=admin/
TBA_API_KEY=
SERVER_IP=https://127.0.0.1
SERVER_IP=https://127.0.0.1
SERVER_MESSAGE=
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ Set the following global environment variables:
- `DEBUG` -> `False`
- `DATABASE_URL` -> `${db.DATABASE_URL}` (This works on DigitalOcean, this may not work on every hosting provider)

Additionally, if you wish to show a custom message to the user on each page (demonstration server, currently undergoing maintenance), set the `SERVER_MESSAGE` environment variable to the message you wish to display.

## Development
### djlint
This project uses `djlint` to lint the templates. You can run this using the following command
Expand Down
21 changes: 13 additions & 8 deletions docs/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ This document describes the roadmap for Open Scouting, and roughly when each fea
---

## To-Do

### `v0.0.6-alpha`
- [ ] [#16](https://github.com/nfoert/open-scouting/issues/16) - Show data in the table differently depending on the kind of field
- [ ] [#23](https://github.com/nfoert/open-scouting/issues/23) - URL Parameter support on `/index`
- [ ] [#20](https://github.com/nfoert/open-scouting/issues/20) - Allow the user to create an account
- [ ] [#13](https://github.com/nfoert/open-scouting/issues/13) - Save the username and team number to Data

---
## Completed
### `v0.0.5-alpha`
- [x] [#41](https://github.com/nfoert/open-scouting/issues/41) - Implement a way to show a server message
- [x] Implement 2025 season fields and examples

### `v0.0.4-alpha`
- [x] [#9](https://github.com/nfoert/open-scouting/issues/9) - Create a wiki page for how season_fields.py should be formatted
- [x] [#7](https://github.com/nfoert/open-scouting/issues/7) - Add a field for additional notes
Expand All @@ -13,14 +26,6 @@ This document describes the roadmap for Open Scouting, and roughly when each fea
- [x] [#38](https://github.com/nfoert/open-scouting/issues/38) - Add demo mode
- [x] [#39](https://github.com/nfoert/open-scouting/issues/39) - Non-ASCII characters in event name breaks data submission

### `v0.0.5-alpha`
- [ ] [#16](https://github.com/nfoert/open-scouting/issues/16) - Show data in the table differently depending on the kind of field
- [ ] [#23](https://github.com/nfoert/open-scouting/issues/23) - URL Parameter support on `/index`
- [ ] [#20](https://github.com/nfoert/open-scouting/issues/20) - Allow the user to create an account
- [ ] [#13](https://github.com/nfoert/open-scouting/issues/13) - Save the username and team number to Data

---
## Completed
### `v0.0.3-alpha`
- [x] [#24](https://github.com/nfoert/open-scouting/issues/24) - Implement a collapsible menu
- [x] [#14](https://github.com/nfoert/open-scouting/issues/14) - Add a dark mode toggle
Expand Down
20 changes: 20 additions & 0 deletions docs/Setting_Up_a_New_Season.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Setting Up a New Season

This page documents which steps should be followed at the start of a season to quickly prepare Open Scouting for a new game

These steps should be followed as early in the season as possible, preferably on kickoff day if possible

## 1. Update `season_fields.py`
- Add a new year to the `season_fields.py` file. Follow [Formatting Season Fields](./Formatting_Season_Fields.md) for how to do this. Data entries should be kept simple and not complicated, simplify or remove any fields that you can, and the very minimum amount of fields should be kept required, the goal is to make the process as easy and quick as possible for scouts.

## 2. Update `views.py` and `models.py`
- Navigate to `/main/views.py`
- Add the new year to the `YEARS` array
- Add to the `get_season_data_from_year` and `get_demo_data_from_year` functions to return the new year's data
- Navigate to `/main/models.py`
- Add the new year to the `YEARS` array as a tuple, just match with the years that are already in this array

## 3. Create demo data
- Follow the instructions in [Creating Demonstration Data](./Creating_Demonstration_Data.md) for how to do this

Open Scouting should now be updated to the new season! You should navigate around and ensure that everything is working as expected
84 changes: 84 additions & 0 deletions scouting/main/demo_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,87 @@
{"name": "amp_shot", "type": "integer", "value": 1},
],
]

reefscape = [
[
{"name": "team_number", "type": "large_integer", "value": "1"},
{"name": "match_number", "type": "large_integer", "value": "001"},
{"name": "auton_moved", "type": "boolean", "value": True},
{"name": "feeder_pickup", "type": "boolean", "value": True},
{"name": "park_in_barge_zone", "type": "boolean", "value": False},
{"name": "climb_shallow", "type": "boolean", "value": True},
{"name": "climb_deep", "type": "boolean", "value": False},
{"name": "coral_levels", "type": "multiple_choice", "value": "Level 1"},
{"name": "auton_coral_scored", "type": "integer", "value": 2},
{"name": "coral_scored", "type": "integer", "value": 4},
{"name": "algae_scored_in_processor", "type": "integer", "value": 2},
],
[
{"name": "team_number", "type": "large_integer", "value": "2"},
{"name": "match_number", "type": "large_integer", "value": "1"},
{"name": "auton_moved", "type": "boolean", "value": True},
{"name": "feeder_pickup", "type": "boolean", "value": False},
{"name": "park_in_barge_zone", "type": "boolean", "value": True},
{"name": "climb_shallow", "type": "boolean", "value": False},
{"name": "climb_deep", "type": "boolean", "value": False},
{
"name": "notes",
"type": "text",
"value": "Could score in the reef but only on level 1",
},
{"name": "coral_levels", "type": "multiple_choice", "value": "Level 1"},
{"name": "auton_coral_scored", "type": "integer", "value": 1},
{"name": "auton_algae_scored_in_processor", "type": "integer", "value": 1},
{"name": "algae_scored_in_net", "type": "integer", "value": 2},
{"name": "algae_scored_in_processor", "type": "integer", "value": 3},
],
[
{"name": "team_number", "type": "large_integer", "value": "3"},
{"name": "match_number", "type": "large_integer", "value": "1"},
{"name": "auton_moved", "type": "boolean", "value": True},
{"name": "feeder_pickup", "type": "boolean", "value": True},
{"name": "park_in_barge_zone", "type": "boolean", "value": False},
{"name": "climb_shallow", "type": "boolean", "value": True},
{"name": "climb_deep", "type": "boolean", "value": False},
{"name": "notes", "type": "text", "value": "Good coral scoring bot"},
{"name": "coral_levels", "type": "multiple_choice", "value": "Level 1"},
{"name": "auton_coral_scored", "type": "integer", "value": 4},
{"name": "coral_scored", "type": "integer", "value": 6},
],
[
{"name": "team_number", "type": "large_integer", "value": "4"},
{"name": "match_number", "type": "large_integer", "value": "1"},
{"name": "auton_moved", "type": "boolean", "value": False},
{"name": "feeder_pickup", "type": "boolean", "value": False},
{"name": "park_in_barge_zone", "type": "boolean", "value": True},
{"name": "climb_shallow", "type": "boolean", "value": False},
{"name": "climb_deep", "type": "boolean", "value": False},
{"name": "notes", "type": "text", "value": "No auton, no climb"},
{"name": "algae_scored_in_net", "type": "integer", "value": 3},
],
[
{"name": "team_number", "type": "large_integer", "value": "5"},
{"name": "match_number", "type": "large_integer", "value": "1"},
{"name": "auton_moved", "type": "boolean", "value": True},
{"name": "feeder_pickup", "type": "boolean", "value": False},
{"name": "park_in_barge_zone", "type": "boolean", "value": True},
{"name": "climb_shallow", "type": "boolean", "value": False},
{"name": "climb_deep", "type": "boolean", "value": False},
{"name": "coral_levels", "type": "multiple_choice", "value": "Level 1"},
{"name": "auton_algae_scored_in_processor", "type": "integer", "value": 1},
{"name": "coral_scored", "type": "integer", "value": 2},
{"name": "algae_scored_in_net", "type": "integer", "value": 1},
{"name": "algae_scored_in_processor", "type": "integer", "value": 2},
],
[
{"name": "team_number", "type": "large_integer", "value": "6"},
{"name": "match_number", "type": "large_integer", "value": "1"},
{"name": "auton_moved", "type": "boolean", "value": False},
{"name": "feeder_pickup", "type": "boolean", "value": False},
{"name": "park_in_barge_zone", "type": "boolean", "value": True},
{"name": "climb_shallow", "type": "boolean", "value": False},
{"name": "climb_deep", "type": "boolean", "value": False},
{"name": "notes", "type": "text", "value": "Only net bot"},
{"name": "algae_scored_in_net", "type": "integer", "value": 4},
],
]
10 changes: 7 additions & 3 deletions scouting/main/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.db import models

YEARS = [(2024, "2024")]
YEARS = [(2024, "2024"), (2025, "2025")]


# Stores individual contributed data for each year and event
class Data(models.Model):
Expand All @@ -10,14 +11,17 @@ class Data(models.Model):
event_code = models.CharField(max_length=99)
data = models.JSONField(default=dict, blank=True)
created = models.DateTimeField(null=True, blank=True)
event_model = models.ForeignKey("Event", on_delete=models.SET_NULL, null=True, blank=True)
event_model = models.ForeignKey(
"Event", on_delete=models.SET_NULL, null=True, blank=True
)

def __str__(self):
return f"Data from {self.event} in {str(self.year)}"

class Meta:
verbose_name_plural = "Data"


class Event(models.Model):
year = models.IntegerField(choices=YEARS)
name = models.CharField(max_length=999)
Expand All @@ -30,4 +34,4 @@ def __str__(self):
if self.custom:
return f"{self.name} in {str(self.year)} (Custom event)"
else:
return f"{self.name} in {str(self.year)}"
return f"{self.name} in {str(self.year)}"
Loading

0 comments on commit 519381f

Please sign in to comment.