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
|
||||
category = request.GET.get('category')
|
||||
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
|
||||
results = []
|
||||
for o in groups:
|
||||
result = dict()
|
||||
result['id'] = str(o.id)
|
||||
print(o.id, o.name)
|
||||
result['name'] = o.name
|
||||
result['image'] = request.build_absolute_uri(o.image.url)
|
||||
results.append(result)
|
||||
|
|
Loading…
Reference in New Issue