Guest User

Untitled

a guest
Oct 31st, 2012
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. class NumberForm(forms.ModelForm):
  2.    
  3.     def __init__(self, *args, **kwargs):
  4.         super(NumberForm, self).__init__(*args, **kwargs)
  5.         self.fields['rooms'].queryset = kwargs['room_queryset']
  6.    
  7.     rooms = forms.ModelChoiceField(label='Room', queryset = Room.objects.none())   
  8.    
  9.     class Meta:
  10.         model = Number
  11.         fields = ('country','routing_rule','rooms')
Advertisement
Add Comment
Please, Sign In to add comment