Answer the question
In order to leave comments, you need to log in
Error while validating the form. What's wrong?
Good day.
From my previous questions, it will be clear that I am trying to make 5 stores with one database on Django-Oscar. I have already done almost everything (divided the models by sites), but I just can’t separate the Offers model between sites. To be more precise, I changed the models (added the Site field, changed the managers), then it remained to change the Forms in the Dashboard.Offers application (Oscar admin panel).
Added the Site field to the form:
if settings.SITE_ID == -1:
SITE_INITIAL = None
SITE_WIDGET=forms.Select()
else:
SITE_INITIAL = Site.objects.get_current().id
SITE_WIDGET=forms.HiddenInput()
class MetaDataForm(OscarMetaDataForm):
site = forms.ModelChoiceField(
queryset=Site.objects.all(),
widget=SITE_WIDGET,
initial=SITE_INITIAL)
class Meta:
model = ConditionalOffer
fields = ('site', 'name', 'description')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question