HUE-5756 [doc2] Set is_tashed for all children recursively when trashed or restored

Review Request #9553 - Created Feb. 15, 2017 and submitted

Sai Chirravuri
hue
master
HUE-5756
36c0371...
hue
enricoberti, johan, ranade, romain, weixia

commit 89300271765bf286f5d2d89f9c0d8bb61508a310
Author: krish krish@cloudera.com
Date: Wed Feb 15 16:37:08 2017 -0800

HUE-5756 [doc2] Set is_tashed for all children recursively when trashed or restored

:100644 100644 2f42d9e... dd08964... M desktop/core/src/desktop/models.py
:100644 100644 bd323e5... 75a2481... M desktop/core/src/desktop/tests.py

manual & unit test

Doesn't show up in saved queries when parent directory of a saved query is trashed.

  • 5
  • 0
  • 0
  • 0
  • 5
Description From Last Updated
Why this and not using 'self'? Romain Rigaux
Could we avoid adding one more method and instead just loop over the files in _trash_or_restore_recursively ? recursive is always ... Romain Rigaux
+= --> .append(child.id) Romain Rigaux
children_ids.extend() Romain Rigaux
Usually we new line after ( then just indent 4 and ) on new line Romain Rigaux
  1. 
      
  2. desktop/core/src/desktop/models.py (Diff revision 1)
     
     

    Why this and not using 'self'?

    1. because self is Document2 object and we will get
      'Document2' object has no attribute 'get_children_documents_list'

  3. desktop/core/src/desktop/models.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    Could we avoid adding one more method and instead just loop over the files in _trash_or_restore_recursively ?

    recursive is always true, needed?

    1. I guess argument 'recursive' can be added as and when needed. Will remove that.

      My intention was to have the recursive directory logic inside the Directory()

  4. 
      
  1. 
      
  2. desktop/core/src/desktop/models.py (Diff revision 2)
     
     

    += --> .append(child.id)

  3. desktop/core/src/desktop/models.py (Diff revision 2)
     
     

    children_ids.extend()

  4. desktop/core/src/desktop/tests.py (Diff revision 2)
     
     
     
     
     
     

    Usually we new line after (

    then just indent 4

    and )
    on new line

  5. 
      
Review request changed

Status: Closed (submitted)

Loading...