daily pastebin goal
80%
SHARE
TWEET

Untitled

a guest Oct 31st, 2012 34 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class NumberForm(forms.ModelForm):
  2.        
  3.         def __init__(self, *args, **kwargs):
  4.                 self.room_queryset = kwargs.pop('room_queryset', None)
  5.                 super(NumberForm, self).__init__(*args, **kwargs)
  6.                 self.fields['rooms'].queryset = self.room_queryset
  7.        
  8.         rooms = forms.ModelChoiceField(label='Room', queryset = Room.objects.none())   
  9.        
  10.         class Meta:
  11.                 model = Number
  12.                 fields = ('country','routing_rule','rooms')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top