Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b3658249ee
Binary file not shown.
|
@ -34,12 +34,13 @@ def groups(request):
|
||||||
user_id = request.user.id
|
user_id = request.user.id
|
||||||
category = request.GET.get('category')
|
category = request.GET.get('category')
|
||||||
q = Group.objects.filter(Q(status=1), Q(
|
q = Group.objects.filter(Q(status=1), Q(
|
||||||
group_user__user__id=user_id) | Q(group_admin__user__id=user_id))
|
group_user__user__id=user_id) | Q(group_admin__user__id=user_id)).distinct()
|
||||||
groups = q.filter(classify=category) if category else q
|
groups = q.filter(classify=category) if category else q
|
||||||
results = []
|
results = []
|
||||||
for o in groups:
|
for o in groups:
|
||||||
result = dict()
|
result = dict()
|
||||||
result['id'] = str(o.id)
|
result['id'] = str(o.id)
|
||||||
|
print(o.id, o.name)
|
||||||
result['name'] = o.name
|
result['name'] = o.name
|
||||||
result['image'] = request.build_absolute_uri(o.image.url)
|
result['image'] = request.build_absolute_uri(o.image.url)
|
||||||
results.append(result)
|
results.append(result)
|
||||||
|
|
Loading…
Reference in New Issue