Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class NumberForm(forms.ModelForm):
- def __init__(self, *args, **kwargs):
- self.room_queryset = kwargs.pop('room_queryset', None)
- super(NumberForm, self).__init__(*args, **kwargs)
- self.fields['rooms'].queryset = self.room_queryset
- rooms = forms.ModelChoiceField(label='Room', queryset = Room.objects.none())
- class Meta:
- model = Number
- fields = ('country','routing_rule','rooms')
Advertisement
Add Comment
Please, Sign In to add comment