Hi,
I am creating a sidebar modules using python so
i created three modules named as utils side and new
in my utils i created the reusability code and
in the side i used that reusability code to register some data
for this point it is good but whenever i am in the third module named as new
if i inserted new data to the side it should add the data to the sidebar
and i am lost in it i can’t find the good solution
tell me if there anything
def SidebarCreation(request,new_fields):
fields=[
{
"icon_url":'Home.jpg',
"url":'',
"Text":'Home',
"position":10,
},
{
"icon_url":'Device_status.png',
"url": '/data/show-masters-data/',
"Text":'Device_status',
"position":20,
},
]
all_fields=fields+new_fields
processed_fields=registering_menus(all_fields)
return render(request, 'data/index.html', {'fields': processed_fields})
this code is in side
and
fields=[
{
"icon_url":'Home.jpg',
"url":'',
"Text":'Home',
"position":50,
},
{
"icon_url":'Device_status.png',
"url": '/data/show-masters-data/',
"Text":'Device_status',
"position":60,
},
]
SidebarCreation(fields)
i tried to import this from side and using it in the new but the data is not adding
can anyone help me on this topic…