def get_context_data(self, **kwargs):
    context = super(FolderView, self).get_context_data(**kwargs)
    context['parent_folders'] = (self.parent.parent_folders if self.parent else [])
    context['current_folder'] = self.parent
    if self.parent:
        context['folders'] = self.parent.get_children()
    else:
        context['folders'] = Folder.objects.filter(parent=self.parent)
    return context
def get_context_data(self, **kwargs):
    context = super(FolderView, self).get_context_data(**kwargs)
    context['parent_folders'] = (self.parent.parent_folders if self.parent else [])
    context['current_folder'] = self.parent
    if self.parent:
        context['folders'] = self.parent.get_children()
    else:
        context['folders'] = Folder.objects.filter(parent=self.parent)
    return context