@@ 49-64 (lines=16) @@ | ||
46 | self.fields['provider'].widget.attrs['class'] = 'form-control' |
|
47 | ||
48 | ||
49 | class ConsumerForm(ServiceChoiceForm): |
|
50 | ||
51 | """ |
|
52 | Set some HTML class to the Consumer form |
|
53 | """ |
|
54 | consumer = forms.ChoiceField() |
|
55 | ||
56 | def __init__(self, *args, **kwargs): |
|
57 | super(ConsumerForm, self).__init__(*args, **kwargs) |
|
58 | # get the list of service without the one selected in |
|
59 | # the provider form |
|
60 | self.fields['consumer'].choices = self.activated_services( |
|
61 | user=self.initial['user'], |
|
62 | provider=self.initial['provider'] |
|
63 | ) |
|
64 | self.fields['consumer'].widget.attrs['class'] = 'form-control' |
|
65 | ||
66 | ||
67 | class ServicesDescriptionForm(forms.Form): |
|
@@ 34-46 (lines=13) @@ | ||
31 | return choices |
|
32 | ||
33 | ||
34 | class ProviderForm(ServiceChoiceForm): |
|
35 | ||
36 | """ |
|
37 | Set some HTML class to the Provider form |
|
38 | """ |
|
39 | provider = forms.ChoiceField() |
|
40 | ||
41 | def __init__(self, *args, **kwargs): |
|
42 | super(ProviderForm, self).__init__(*args, **kwargs) |
|
43 | self.fields['provider'].choices = self.activated_services( |
|
44 | user=self.initial['user'] |
|
45 | ) |
|
46 | self.fields['provider'].widget.attrs['class'] = 'form-control' |
|
47 | ||
48 | ||
49 | class ConsumerForm(ServiceChoiceForm): |