I'm guessing that this last piece of code is part of a custom view and not somehow part of the model...
I think your on the right track with your primary description of discriminating in the data() method. The only minor thing I do differently is contain the "type" in my item node instead of a custom role. Just a personal preference.
Mind you, I'm not an expert yet though. -travlr
Bookmarks