def render(self, context):
        request = context['request']
        community = self.community.resolve(context)
        messages = get_all_messages(request, community.pk if community else 0)
        messages = messages.order_by('-time_updated')

        context[self.var_name] = []
        nbfiles = self.number
        for msg in messages:
            if nbfiles == 0:
                break
            path = "%s/%s" % (get_upload_communities(), msg.pk)
            try:
                files = []
                for f in os.listdir(path):
                    files.append(f)
                    nbfiles -= 1
                    if nbfiles == 0:
                        break
                context[self.var_name].append({'message': msg, 'files': files})
            except:
                pass
        return ''
dataset/ETHPy150Open zorna/zorna/zorna/communities/templatetags/communities_tags.py/last_communities_attachments.render/original