This is probably the most simple Django Views.py file ever. I’m just not there yet. I’ve been reading about using the generic views in your own views, but I haven’t implemented that yet. I’ve not posted the templates as I had mentioned in the last post. I’m still struggling with getting the value out of the podcast genre choices field. I can get the first element of the dictionary, but I want the second one. Actually just thinking about it now, there is probably a model function that needs to return the second element of the dictionary. I’ll probably have to write that myself. If you have a suggestion for that, leave a comment.
Here is the content of the uber simple Views.py:
from django.shortcuts import render_to_response
from podcasts.models import Podcast
def indexPage(request):
return render_to_response('podcast/index.html',{})
I think it’s probably time to create some genre sorted views to go along with the time based list. That will be next. Meanwhile, seriously, if you have a suggestion about getting that choice element out into the template, leave a comment.













