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

234
Views
Cómo puedo conectar cada nombre en la lista usando el concepto de identificación (python)

Creé una página de lista de usuarios y una página de perfil de usuario y quiero que, cuando haga clic en cualquier nombre de la lista, muestre esa página de perfil de usuario.

en .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 de la página de lista de usuarios

 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})

direcciones URL

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

página de perfil

 <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

debes obtener profile_id en url.py así:

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

luego llámalo en tu plantilla:

 {% 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!