Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create SDK League Slug #469

Closed
SThornewillvE opened this issue Jan 2, 2022 · 2 comments
Closed

Create SDK League Slug #469

SThornewillvE opened this issue Jan 2, 2022 · 2 comments

Comments

@SThornewillvE
Copy link

There is a new SDK League for OSR but no way to automatically link to the active league for the dropdown menu in the website.

In order to acheive this, we need a new url pattern in this file, which will probably look something like this:

url(r'^sdk/$', views.sdk, name='sdk'),

There also likely needs to be a new function in "views".

Thank you very much!

@SThornewillvE
Copy link
Author

The new function needs to be here.

@climu
Copy link
Owner

climu commented Jan 2, 2022

There also likely needs to be a new function in "views".

One can take inspiration from:

def meijin(request):
"""A simple view that redirects to the last open meijin league."""
league = LeagueEvent.objects.filter(
event_type='meijin',
is_open=True,
community__isnull=True
).order_by('end_time').first()
return HttpResponseRedirect(reverse(
'league:results',
kwargs={'event_id': league.pk})
)

I guess we also need a new sdk event_type:
EVENT_TYPE_CHOICES = (
('ladder', 'ladder'),
('league', 'league'),
('meijin', 'meijin'),
('dan', 'dan'),
('ddk', 'ddk'),
('tournament', 'tournament'),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants