Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

236
Views
How I can connect each name in list using id concept (python)

I created a list of users page and user profile page and I want when click on any name in the list it should show that user profile page.

in .html

<table class="table table-striped " id="table1"> 
<thead> 
<tr class="feed-bg text-white "> 
<th>Employee Name</th>
 <th>Employee Email</th>
 </tr>
 </thead> 
<tbody> 
{% for i in data_list %} 
<tr>
  <td>{{ forloop.counter }}</td>
  <td><a href="/user/edit_profile/"> {{i.employee_name}} </a></td>
  <td>{{i.employee_email}}</td>
 </tr> 
{% endfor %}
 </tbody> 
</table>

view.py of user list page

def user_list(request): 
data_list = [] 
get_user_details = CustomUser.objects.all() 
for i in get_user_details: 
data_dict = {} 
data_dict['employee_name'] = i.username 
data_dict['email'] = i.email 
data_list.append(data_dict) 
 return render(request, 'user_list.html', {'data_list': data_list})

urls

 path('user_list/', views.user_list, name='user_list'),
 path('profile/', views.profile, name='profile'), 

profile page

<div class="row r-bg mt-3"> 
<div class="row g-3">
{% for data in get_user_details %}
<div class="col-md-3"> 
<label for="username" class="form-label">Full Name *</label>
<input type="text" class="form-control" name="username" id="username" value="{{data.username}}"> </div> 
<div class="col-md-3"> 
<label for="email" class="form-label">Email *</label> 
<input type="email" class="form-control" name="email" id="email" value="{{data.email}}">
</div> 
</div>
<div class="row mt-5"> 
<div class="col-md-8 mt-3">
<button type="button" class="btn btn-outline-primary">save</button>
</div> 
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you must get profile_id in url.py like this:

path('profile/<int:profile_id>', views.profile, name='profile'), 

then call that in your template:

{% url profile 'profile' i.profile_id %}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!