Third-party plugins


Define a link from your model to the organizations.Organization model:

class Box(models.Model):
    org = models.ForeignKey(
    # Then your model attributes go here...

Then ensuring your ListView only shows Box objects from an org that the user is part of:

class BoxListView(ListView):
    model = Box

    def get_queryset(self):
        return Box.objects.filter(org__users=self.request.user)

Then you can render a list in box_list.html:

{% block content %}
  <h1>Box List</h1>
  {% if object_list %}
      {% for box in object_list %}
        <a href="{% url 'box_detail' %}">{{ box.title }} (Team: {{ }})</a>
      {% endfor %}
  {% else %}
    <p>Your team currently has no boxes. Would you like to create one?</p>
  {% endif %}
{% endblock %}