Merge lp:~nigelbabu/summit/fix-tracks-and-topics into lp:summit

Proposed by Nigel Babu
Status: Merged
Approved by: Michael Hall
Approved revision: 64
Merged at revision: 69
Proposed branch: lp:~nigelbabu/summit/fix-tracks-and-topics
Merge into: lp:summit
Diff against target: 24 lines (+6/-1)
1 file modified
summit/schedule/forms.py (+6/-1)
To merge this branch: bzr merge lp:~nigelbabu/summit/fix-tracks-and-topics
Reviewer Review Type Date Requested Status
Summit Hackers Pending
Review via email: mp+49761@code.launchpad.net

Description of the change

Filters the topics and tracks form to show only the relevant topics and tracks

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'summit/schedule/forms.py'
2--- summit/schedule/forms.py 2010-03-05 10:33:36 +0000
3+++ summit/schedule/forms.py 2011-02-15 03:19:15 +0000
4@@ -16,7 +16,7 @@
5
6 from django import forms
7
8-from summit.schedule.models import Attendee
9+from summit.schedule.models import Attendee, Track, Topic
10
11 __all__ = (
12 'TestForm',
13@@ -25,6 +25,11 @@
14
15 class AttendeeInterestForm(forms.ModelForm):
16
17+ def __init__(self, *args, **kwargs):
18+ super(AttendeeInterestForm, self).__init__(*args, **kwargs)
19+ self.fields['tracks'].queryset = Track.objects.filter(summit=self.instance.summit)
20+ self.fields['topics'].queryset = Topic.objects.filter(summit=self.instance.summit)
21+
22 class Meta:
23 model = Attendee
24 fields = ('tracks', 'topics')

Subscribers

People subscribed via source and target branches