Skip to content

Instantly share code, notes, and snippets.

Avatar

Aishwary Dhare aishwarydhare

  • Zuka Technologies Pvt. Ltd.
  • Bangalore, India
View GitHub Profile
@aishwarydhare
aishwarydhare / django_nav_menu_maker.py
Last active Mar 4, 2019
Creating a MenuList : Django Admin App
View django_nav_menu_maker.py
from collections import OrderedDict
from django.urls import resolve
from django.urls import reverse
def get_menu(context):
# [ 'display name', 'level 1 parent (optional)', 'django url', 'css icon', 'level 2 parent (optional)']
menus = [
['solo', '', 'solo_url', 'fa fa-desktop'],
['test', '', '', 'fa fa-desktop'],