| Home | Trees | Indices | Help |
|---|
|
|
1 from django.db.models import FieldDoesNotExist, DateTimeField 2 from django.http import Http404 3 from django.shortcuts import render_to_response 4 from django.contrib.databrowse.datastructures import EasyModel, EasyChoice 5 6 ########### 7 # CHOICES # 8 ########### 911 m, f = lookup_field(app_label, module_name, field_name, models) 12 return render_to_response('databrowse/choice_list.html', {'model': m, 'field': f})1315 m, f = lookup_field(app_label, module_name, field_name, models) 16 try: 17 label = dict(f.field.choices)[field_val] 18 except KeyError: 19 raise Http404('Invalid choice value given') 20 obj_list = m.objects(**{f.field.name: field_val}) 21 return render_to_response('databrowse/choice_detail.html', {'model': m, 'field': f, 'value': label, 'object_list': obj_list})22
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Thu Apr 17 18:52:40 2008 | http://epydoc.sourceforge.net |