I believe that this verifies the relationships, would you agree?
It should.
So assuming that the portions of the code you posted at HTML for loop gives all values - #17 by jslovern391 are the current versions, what’s actually being rendered? (Please post the HTML that was rendered and not an image of the displayed page.)
{% extends 'base.html' %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fisher List</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</head>
<body>
{% block body %}
<h1>{{organizations}</h1>
<div class="container mt-2">
<h2>Organizations</h2>
<table class="table table-striped table-bordered">
<thead class="thread-dark thread-center" >
<tr>
<th scope="col">Org Owner</th>
<th scope="col">Org Name</th>
<th scope="col">Email</th>
<th scope="col">Text(coming soon)</th>
<th scope="col">Other Actions</th>
</tr>
</thead>
<tbody>
{% for fisher in fishers %}
<tr>
<td>{{ fisher.alias_name }}</td>
<td hidden>{{ fisher.org_id }}</td>
<td> {{ fisher.org.org_name }} </td>
<td>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" data-bs-whatever="@mdo">Send Email</button>
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Email Message</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form>
<div class="mb-3">
<label for="recipient-name" class="col-form-label">Recipient:</label>
{{ fisher.alias_name }}
</div>
<div class="mb-3">
<label for="message-text" class="col-form-label">Message:</label>
<textarea class="form-control" id="message-text"></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-bs-dismiss="modal">Close</button>
<a href="{% url 'email_button' fisher.id sponsor %}" class="btn btn-secondary">Send Email</button></a>
</div>
</div>
</div>
</td>
<td><a href="#" class="btn btn-success disabled">Send Text</button></td>
<td>
<div class="dropdown">
<button class="btn btn-dark dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown button
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li><a class="dropdown-item" href="#">No Actions</a></li>
</ul>
</div>
</td>
</tr>
{% empty %}
<h4>No Organizations yet.</h4>
{% endfor %}
</tbody>
</table>
</div>
{% endblock body %}
</body>
</html>
I need to see the html that was rendered, as it is seen in the browser, not the template being rendered.
Is this what you are looking for?
<!DOCTYPE html>
<html>
<head>
<title></title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</head>
<body>
<nav class="navbar navbar-primary bg-primary flex-row">
<a class="navbar-brand" href="#">
<img src="/media/" alt="" width="60" height="30">
</a>
<ul class="nav navbar-dark bg-primary flex-row-reverse">
<li class="nav-item">
<a class='nav-link text-white' href="/accounts/qrcode_button/">Fish QRCode</a>
</li>
<li class="nav-item">
<a class='nav-link text-white' href="/logout/">Logout</a>
</li>
<li class="nav-item">
<a class='nav-link text-white' href="/login/">Login</a>
</li>
<li class="nav-item ">
<a class='nav-link text-white' href="#">Donate</a>
</li>
<li class="nav-item ">
<a class='nav-link text-white' href="/accounts/index/">Home</a>
</li>
</ul>
</div>
</nav>
<h2><center><font color="red">THIS IS A TEST SITE. DO NOT USE FOR EVANGELIZING!!!!</font></center></h2>
<h1>{{organizations}</h1>
<div class="container mt-2">
<h2>Organizations</h2>
<table class="table table-striped table-bordered">
<thead class="thread-dark thread-center" >
<tr>
<th scope="col">Org Owner</th>
<th scope="col">Org Name</th>
<th scope="col">Email</th>
<th scope="col">Text(coming soon)</th>
<th scope="col">Other Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>cara_l1234</td>
<td hidden>54</td>
<td> </td>
<td>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" data-bs-whatever="@mdo">Send Email</button>
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Email Message</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form>
<div class="mb-3">
<label for="recipient-name" class="col-form-label">Recipient:</label>
cara_l1234
</div>
<div class="mb-3">
<label for="message-text" class="col-form-label">Message:</label>
<textarea class="form-control" id="message-text"></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-bs-dismiss="modal">Close</button>
<a href="/accounts/email_button/35/2/" class="btn btn-secondary">Send Email</button></a>
</div>
</div>
</div>
</td>
<td><a href="#" class="btn btn-success disabled">Send Text</button></td>
<td>
<div class="dropdown">
<button class="btn btn-dark dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown button
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li><a class="dropdown-item" href="#">No Actions</a></li>
</ul>
</div>
</td>
</tr>
<tr>
<td>jeff_u2442</td>
<td hidden>55</td>
<td> </td>
<td>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" data-bs-whatever="@mdo">Send Email</button>
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Email Message</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form>
<div class="mb-3">
<label for="recipient-name" class="col-form-label">Recipient:</label>
jeff_u2442
</div>
<div class="mb-3">
<label for="message-text" class="col-form-label">Message:</label>
<textarea class="form-control" id="message-text"></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-bs-dismiss="modal">Close</button>
<a href="/accounts/email_button/32/2/" class="btn btn-secondary">Send Email</button></a>
</div>
</div>
</div>
</td>
<td><a href="#" class="btn btn-success disabled">Send Text</button></td>
<td>
<div class="dropdown">
<button class="btn btn-dark dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown button
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li><a class="dropdown-item" href="#">No Actions</a></li>
</ul>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Footer -->
<footer class="text-center text-lg-start bg-white text-muted">
<!-- Section: Social media -->
<section class="d-flex justify-content-center justify-content-lg-between p-4 border-bottom">
<!-- Left -->
<div class="me-5 d-none d-lg-block">
</div>
<!-- Left -->
<!-- Right -->
<!-- Right -->
</section>
<!-- Section: Social media -->
<!-- Section: Links -->
<section class="">
<div class="container text-center text-md-start mt-5">
<!-- Grid row -->
<div class="row mt-3">
<!-- Grid column -->
<div class="col-md-3 col-lg-4 col-xl-3 mx-auto mb-4">
<!-- Content -->
<h6 class="text-uppercase fw-bold mb-4">
<i class="fas fa-gem me-3 text-secondary"></i>Company name
</h6>
<p>
Here you can use rows and columns to organize your footer content. Lorem ipsum
dolor sit amet, consectetur adipisicing elit.
</p>
</div>
<!-- Grid column -->
<!-- Grid column -->
<div class="col-md-2 col-lg-2 col-xl-2 mx-auto mb-4">
<!-- Links -->
<h6 class="text-uppercase fw-bold mb-4">
Products
</h6>
<p>
<a href="#!" class="text-reset">Angular</a>
</p>
<p>
<a href="#!" class="text-reset">React</a>
</p>
<p>
<a href="#!" class="text-reset">Vue</a>
</p>
<p>
<a href="#!" class="text-reset">Laravel</a>
</p>
</div>
<!-- Grid column -->
<!-- Grid column -->
<div class="col-md-3 col-lg-2 col-xl-2 mx-auto mb-4">
<!-- Links -->
<h6 class="text-uppercase fw-bold mb-4">
Useful links
</h6>
<p>
<a href="#!" class="text-reset">Pricing</a>
</p>
<p>
<a href="#!" class="text-reset">Settings</a>
</p>
<p>
<a href="#!" class="text-reset">Orders</a>
</p>
<p>
<a href="#!" class="text-reset">Help</a>
</p>
</div>
<!-- Grid column -->
<!-- Grid column -->
<div class="col-md-4 col-lg-3 col-xl-3 mx-auto mb-md-0 mb-4">
<!-- Links -->
<h6 class="text-uppercase fw-bold mb-4">Contact</h6>
<p><i class="fas fa-home me-3 text-secondary"></i> New York, NY 10012, US</p>
<p>
<i class="fas fa-envelope me-3 text-secondary"></i>
info@example.com
</p>
<p><i class="fas fa-phone me-3 text-secondary"></i> + 01 234 567 88</p>
<p><i class="fas fa-print me-3 text-secondary"></i> + 01 234 567 89</p>
</div>
<!-- Grid column -->
</div>
<!-- Grid row -->
</div>
</section>
<!-- Section: Links -->
<!-- Copyright -->
<div class="text-center p-4" style="background-color: rgba(0, 0, 0, 0.025);">
© 2021 Copyright:
<a class="text-reset fw-bold" href="https://mdbootstrap.com/">MDBootstrap.com</a>
</div>
<!-- Copyright -->
</footer>
<!-- Footer -->
</body>
</html>
Yes, thank you.
There’s definitely something odd going on here, and I can’t quite see what it might be.
Please confirm that you only have one org_list
function in your views.py file. (Or, better yet, please confirm that there is only one function named org_list
anywhere in your project.)
Likewise, please confirm that there is only one org_list.html
template file in your project.
Did search
only one org_list.html
views = 2
@login_required
def org_list(request):
fishers = CustomUser.objects.all().filter(sponsor=request.user.pk).values().filter(status=7)
context = {
'fishers': fishers,
'sponsor': request.user.pk,
}
return render(request, 'accounts/org_list.html', context)
URLs = 3
path('org_list/', views.org_list, name='accounts/org_list'),
What do you mean by “views = 2” ? (and “URLs = 3”?)
Ok, I finally scrolled off to the right far enough to see it.
You still have a “values” clause in your query.
Remove it.
That did it. Thanks much!