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())
|
||||
return app_scopes.intersection(all_scopes)
|
||||
|
||||
# @property
|
||||
# def available_scopes(self):
|
||||
@property
|
||||
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>
|
||||
</th>
|
||||
{# <th>actions</th>#}
|
||||
<th>application</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for scope in object.scopes.all %}
|
||||
{% for scope in object.allowed_scopes_queryset %}
|
||||
<tr>
|
||||
<td>{{ scope.name }}</td>
|
||||
<td>{{ scope.description }}</td>
|
||||
<td>{{ scope.application }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue