<p>I need to create a cherrypy main page that has a login area.  I want the login area to be secure, but not the rest of the page.  How can I do this in CherryPy?</p>

<p>Ideally, any suggestions will be compatible with <a href="http://web.archive.org/web/20170210040849/http://tools.cherrypy.org:80/wiki/AuthenticationAndAccessRestrictions" rel="nofollow noreferrer">http://web.archive.org/web/20170210040849/http://tools.cherrypy.org:80/wiki/AuthenticationAndAccessRestrictions</a></p>

Frankly - tying data (the position in your data vector) to the presentation of the data in the list control (the position in the list ctrl) is something I would stay away from.
In MFC each control has a "Data" DWORD member variable - when coding in MFC I Always called "SetItemData" for each item added and passed in a pointer that the relevant row referred to e.g.
```
YourListCtrl.SetItemData((DWORDPTR)&YourData);
```
Then when the ListCtrl item is selected, you just call
```
DataTypeYouWant* pData =  (DataTypeYouWant*)(YourListCtrl.GetItemData(indexofselecteditem));
```
Or somesuch thing.
Alternatively - if you don't want to use pointers - hold the index of the item in your original vector in the itemdata for your row (just pass it into the above fns).