Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

238
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda