allowed_scopes_queryset
This commit is contained in:
parent
c32d9b75c2
commit
125c123010
2 changed files with 7 additions and 4 deletions
|
|
@ -54,8 +54,10 @@ class Application(AbstractApplication):
|
||||||
app_scopes = set(self.allowed_scope.split())
|
app_scopes = set(self.allowed_scope.split())
|
||||||
return app_scopes.intersection(all_scopes)
|
return app_scopes.intersection(all_scopes)
|
||||||
|
|
||||||
# @property
|
@property
|
||||||
# def available_scopes(self):
|
def allowed_scopes_queryset(self):
|
||||||
|
allowed_scopes = self.allowed_scopes
|
||||||
|
return Scope.objects.filter(name__in=allowed_scopes).order_by('name')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,14 +47,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</th>
|
</th>
|
||||||
{# <th>actions</th>#}
|
<th>application</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for scope in object.scopes.all %}
|
{% for scope in object.allowed_scopes_queryset %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ scope.name }}</td>
|
<td>{{ scope.name }}</td>
|
||||||
<td>{{ scope.description }}</td>
|
<td>{{ scope.description }}</td>
|
||||||
|
<td>{{ scope.application }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue