file_sp now honours offset and how_many, and if you go into a new dir (up or down), offset is put back to 0 - this seems functional now, need to functionalise/replicate into files_ip and files_rbp
This commit is contained in:
4
files.py
4
files.py
@@ -229,8 +229,10 @@ def files_sp():
|
|||||||
if len(rp) and rp[0] == '/':
|
if len(rp) and rp[0] == '/':
|
||||||
rp=rp[1:]
|
rp=rp[1:]
|
||||||
dir=Entry.query.join(Dir).join(PathDirLink).join(Path).filter(Dir.rel_path==rp).filter(Path.path_prefix==prefix).order_by(Entry.name).first()
|
dir=Entry.query.join(Dir).join(PathDirLink).join(Path).filter(Dir.rel_path==rp).filter(Path.path_prefix==prefix).order_by(Entry.name).first()
|
||||||
entries+= Entry.query.join(EntryDirLink).filter(EntryDirLink.dir_eid==dir.id).order_by(Entry.name).all()
|
entries+= Entry.query.join(EntryDirLink).join(FileType).filter(EntryDirLink.dir_eid==dir.id).filter(FileType.name=='Directory').all()
|
||||||
|
|
||||||
if noo == "Oldest":
|
if noo == "Oldest":
|
||||||
|
print( Entry.query.join(File).join(EntryDirLink).filter(EntryDirLink.dir_eid==dir.id).order_by(File.year,File.month,File.day,Entry.name).offset(offset).limit(how_many))
|
||||||
entries+=Entry.query.join(File).join(EntryDirLink).filter(EntryDirLink.dir_eid==dir.id).order_by(File.year,File.month,File.day,Entry.name).offset(offset).limit(how_many).all()
|
entries+=Entry.query.join(File).join(EntryDirLink).filter(EntryDirLink.dir_eid==dir.id).order_by(File.year,File.month,File.day,Entry.name).offset(offset).limit(how_many).all()
|
||||||
else:
|
else:
|
||||||
entries+=Entry.query.join(File).join(EntryDirLink).filter(EntryDirLink.dir_eid==dir.id).order_by(File.year.desc(),File.month.desc(),File.day.desc(),Entry.name).offset(offset).limit(how_many).all()
|
entries+=Entry.query.join(File).join(EntryDirLink).filter(EntryDirLink.dir_eid==dir.id).order_by(File.year.desc(),File.month.desc(),File.day.desc(),Entry.name).offset(offset).limit(how_many).all()
|
||||||
|
|||||||
Reference in New Issue
Block a user