Code Monkey home page Code Monkey logo

hbscorez's Introduction

Hi there 👋

hbscorez's People

Contributors

dependabot[bot] avatar djbrown avatar fossabot avatar jupadin avatar pyup-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hbscorez's Issues

[H4A] Seperation of Fourth Division Districts

Fourth Divisions used to be listed as districts in related Associations.
Now the Fourth Division Leagues are only listed directly in the Fourth Division Associations without visible District.

The District "BWOL" used to be listed the Asscociaton HVW.
Now it is only visible in the dedicated Association HBW.

Therefore importing Fourth Divisions is not possible:
setup -a 3 -d 4 -s 2018 -l 35068 -> no Districs and Leagues found.

Also the Navigation should be updated to resemble this relation, e.g. like in the new H4A-Portal.

include slugs in URLs

Description

As a Viewer I want to have meaningful URLs so I know which content I would visit before actually going there.

Feature: Team Logos

As a Club or Team Associate I want to specify a Club or Team Logo by uploading the Image File.

src/teams/models.py

logo = models.ImageField(upload_to=os.path.join(settings.MEDIA_ROOT, 'club-logos'))

Games not updated if only certain properties have changed

Steps to reproduce

  1. import game
  2. change home_goals, guest_goals or report_number
  3. import game (again)
  4. ⚠️ game not updated!

Relevant Code

The game is only saved if properties have changed.
For deleting Scores the properties are split into two groups. First one is:

defaults: dict[str, Any | None] = {
"home_goals": home_goals,
"guest_goals": guest_goals,
"report_number": report_number,
}
updated = ensure_defaults(game, defaults)

The problem ist, that the updated flag is overwritten and set only if following properties have changed:

hbscorez/src/base/logic.py

Lines 97 to 105 in 685f122

defaults = {
"opening_whistle": opening_whistle,
"sports_hall": sports_hall,
"forfeiting_team": forfeiting_team,
}
updated = ensure_defaults(game, defaults)
if updated:
game.save()

So if only the former properties have changed, the game isn't updated in the database.

Problem with missing report folder

Hey,
i have some problems with the import_scores.py file. The script will crash if the report folder is missing at line 91.
I solve the problem by adding the following line of code above.
os.makedirs(os.path.dirname(game.report_path()), exist_ok=True)

'Player' object is not iterable

Hey,
all first I want to thank you for your great Job.
I also know that you want to use Redmine (I don't know why), but here it is easier to connect this issue to code.
I think in the code below is a little bug, since the last update. I get follow exception: "TypeError: 'Player' object is not iterable".

player, created = models.Player.objects.get_or_create(name=player_name, team=team)[0]

The fix is to remove the call for the first array element.

I came across this when I want to change the Team based "Torjäger" list to display also Player with zero goals. (Maybe this is also a nice Feature =) )

Thanks and have a nice Sunday

Doppelverwendung der Variablen für Tore

Hi @djbrown,

s. Anzahl der Spiele für die aktuelle Saison 23/24 bei https://hbscorez.de/spieler/414186/.
Hier dürften (Stand heute 24.10.23) lediglich 5 Spiele stehen, wird aber die Variable für die Anzahl der geworfenen Tore verwendet:

<h2>Statistiken</h1>
<p>Spiele: {{scorer.total_goals}}
<p>Tore: {{scorer.total_goals}}
<p>7m: {{scorer.total_penalty_goals}} von {{scorer.total_penalty_tries}}

PR-Fix kann ich gerne erstellen - Issue ansonsten auch gerne einfach direkt schließen, falls du das schon erledigt hast bzw. machst.

Viele Grüße

Run pylint in ci-build and pr-build

pipenv run pylint should be executed for every push
already documented in README.md:

## Code Formatting and Style Guide
You may contribute to this Project using any IDE, Editor or Terminal you like, as long as your modifications obey the conventions defined by the [Style Guide for Python Code (PEP8)](https://www.python.org/dev/peps/pep-0008/).
The following command will clean your code accordingly: `pipenv run autopep8`
Also make sure to check messages from the following commands before proposing:
- `pipenv run mypy src`
- `pipenv run flake8`
- `pipenv run pylint src`

Verbandsabkürzungen in Großbuchstaben

Hi @djbrown,

wie findest Du die Idee, die Abkürzungen des jeweiligen Verbands als Großbuchstaben darzustellen ?

def parse_association_abbreviation(association_url: str) -> str:
return association_url.rsplit('/', 1)[1]

Mit entsprechender Anpassung des folgenden Tests

def test_abbreviation(self):
url = 'https://www.handball4all.de/home/portal/bhv'
actual = parsing.parse_association_abbreviation(url)
expected = 'bhv'
self.assertEqual(expected, actual)

Ggfs. würde ich hier noch eine Anpassung des Funktionsnamens zu test_parse_association_abbreviation vorschlagen. Wie siehst Du das ?

Viele Grüße

Feature: Scorer Year of Birth

Currently there is an empty Column Jahrgang in Game Reports.
This would ideally contain the Year of Birth of the respective Participant.

src/players/management/commands/import_reports.py

def import_scores(table, game: Game, team: Team):
    player_year_of_birth = row_data[2]

Alternative: allow Users to enter their Year (or Date) of Birth in their Profile.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.