Returns a formatted HTML link tag to the FileNode’s file, optionally including some meta information about the file.
Almost the same as get_nested_filenode_list(), but returns a flat (one-dimensional) list. Using the same QuerySet as in the example for get_nested_filenode_list, this method would return:
[
<FileNode: Empty folder>,
<FileNode: Photo folder>,
<FileNode: photo1.jpg>,
<FileNode: photo2.jpg>,
<FileNode: photo3.jpg>,
<FileNode: file.txt>
]
Returns a nested list of nodes, applying optional filters and processors to each node. Nested means that the resulting list will be multi-dimensional, i.e. each item in the list that is a folder containing child nodes will be followed by a sub-list containing those child nodes.
Example of returned list:
[
<FileNode: Empty folder>,
<FileNode: Photo folder>,
[<FileNode: photo1.jpg>, <FileNode: photo2.jpg>,
<FileNode: another subfolder>],
[<FileNode: photo3.jpg>]
<FileNode: file.txt>
]
You can use this list in conjunction with Django’s built-in list template filters to output nested lists in templates:
{{ some_nested_list|unordered_list }}
Using the FileNode structure from the example, the above line would result in the following output:
<ul>
<li>Empty folder</li>
<li>Photo folder
<ul>
<li>photo1.jpg</li>
<li>photo2.jpg</li>
<li>another subfolder
<ul>
<li>photo3.jpg</li>
</ul>
</li>
</ul>
</li>
<li>file.txt</li>
</ul>
Parameters: |
|
---|