|
|
|
|
@ -314,6 +314,11 @@ class MainUpdateForm(forms.ModelForm): |
|
|
|
|
|
|
|
|
|
class TopMixinForm(forms.ModelForm, FieldsetMixin): |
|
|
|
|
cities = forms.CharField(label=_(u'Город'), widget=forms.HiddenInput() ,required=False) |
|
|
|
|
country = forms.MultipleChoiceField( |
|
|
|
|
label=u'Страны', |
|
|
|
|
choices=[[x.pk, x.name] for x in list(set(Country.objects.all()))], |
|
|
|
|
required=False |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
|
|
model = Top |
|
|
|
|
@ -356,6 +361,9 @@ class TopMixinForm(forms.ModelForm, FieldsetMixin): |
|
|
|
|
old_save_m2m = self.save_m2m |
|
|
|
|
|
|
|
|
|
def save_m2m(): |
|
|
|
|
print 111111111 |
|
|
|
|
print self |
|
|
|
|
print self.cleaned_data['country'] |
|
|
|
|
old_save_m2m() |
|
|
|
|
# This is where we actually link the pizza with toppings |
|
|
|
|
top.theme.clear() |
|
|
|
|
|