Как показать имена схем арендаторов в моем шаблоне - django?
Я пытаюсь вернуть имена схем арендаторов в данные одной из моих таблиц и я использую django-tenant вот чего я пытаюсь достичь
class Vistor(models.Model):
admin = models.ForeignKey(User,on_delete=models.PROTECT,default=1)
full_name = models.CharField(max_length=150)
@login_required
def daily_vistors_detail_html(request,day):
lists = BookingVisitor.objects.annotate(day=TruncDay('date')).filter(day=day).order_by('-pk')
context = {
'lists':lists
}
Иногда мне приходится возвращать данные с их доменом арендатора!
<table class="w-full text-center table-auto display nowrap" style="width:100%" id="vistors">
<thead>
<tr>
<th class="p-2 text-xs text-white bglightpurple md:text-base">{% trans "admin" %}</th>
<th class="p-2 text-xs text-white bglightpurple md:text-base">{% trans "full name" %}</th>
<th class="p-2 text-xs text-white bglightpurple md:text-base">{% trans "tenant name" %}</th>
</tr>
</thead>
<tbody id="list_vistors_daily" class="w-full">
{% for i in lists %}
<tr>
<td class="p-2 text-xs border border-purple-900 md:text-base textpurple">{{i.admin}}</td>
<td class="p-2 text-xs border border-purple-900 md:text-base textpurple">{{i.visitor.full_name}}</td>
<td class="p-2 text-xs border border-purple-900 md:text-base textpurple">{{tenant name}}</td><!-- this is should return the current tenant name -->
Есть ли способ вернуть имя текущего арендатора из представления?! спасибо заранее