Skip to content Skip to sidebar Skip to footer

How To Get Employee Id Using Excel Sheet

I have created a system (in Django) where whenever I upload an excel file to the website, it will be loaded into the database. How do I retrieve the EmpID from the DB and show it i

Solution 1:

In your ViewClaim,

def ViewClaim(request): 
    context = initialize_context(request) 
    user = context['user'] 
    claims = Claims.objects.all()
    # Fetches the employee ids of all Employees
    emp_ids = Employee.objects.all() 
    
    return render(request, 'User/ViewClaim.html', {'date': x, 'user':user, 'claims':claims, 'emp_ids': emp_ids})

In your Viewclaim.html

{% for emp in emp_ids %}
    <h1> Emp id: {{ emp.EmpID }} </h1>
{% endfor %}

Post a Comment for "How To Get Employee Id Using Excel Sheet"