Building a dynamic tree with session information in Django (template question) -


So I have expansion / falling trees which I keep track of session data

I want to be able to render the tree in Zago based on session data.

I am saving the state like this:

  In my template for rendering, I am looping through items and wanting for each item Set the visibility of the object for example:  %} for items in {%} and 

is the place where I am confused

Can I specify:

  request .session.treedata. (Item.id)  

or

  request.session.treedata. (Forloop.counter)  

Do I have to pre-process the item and state in a new reference variable?

Thanks

Assume that items is a model, and item_id is item.id , you should be able to:

  {item items %%} in & lt; Div {% if request.session.treed.titem.id%} style = "display: none" {% endif%} & gt; The contents of the subtree & lt; / Div & gt; {% Endfor%}  

You can read about how the dynamo template is seeing variables here:


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -