Skip to content

Commit

Permalink
Type hint nav_menu_items
Browse files Browse the repository at this point in the history
  • Loading branch information
medihack committed Feb 9, 2024
1 parent 5e414dc commit 227eaae
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions radis/core/site.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
from typing import Any
from typing import Any, NamedTuple

from django.conf import settings
from django.http import HttpRequest
from django.middleware.csrf import get_token

nav_menu_items = []

class NavMenuItem(NamedTuple):
url_name: str
label: str


nav_menu_items: list[NavMenuItem] = []


def register_main_menu_item(url_name: str, label: str) -> None:
nav_menu_items.append({"url_name": url_name, "label": label})
nav_menu_items.append(NavMenuItem(url_name, label))


def base_context_processor(request: HttpRequest) -> dict[str, Any]:
Expand Down

0 comments on commit 227eaae

Please sign in to comment.