Daevaorn
Какая джанга?
1.0
Daevaorn
Как выглядят формы?
class ProfileEdit(forms.Form):
id = forms.IntegerField(widget=widgets.HiddenInput(),initial=0);
name = forms.CharField(max_length=100,label=_('Displayed Name'));
email = forms.EmailField(label='Email',max_length=75)
send_emails=forms.BooleanField(widget=widgets.CheckboxInput,label='Send Email',required=False)
location = forms.CharField(max_length=100,required=False,label=_('Country,City'))
to_contact=forms.CharField(max_length=100,required=False,label=_('Contact,Enterprise'))
how_contact = forms.CharField(max_length=100,required=False,label=_('Phone, Fax, Email, Website'))
def_tags = forms.CharField(max_length=100,required=False,label=_('Your default Tags'))
class BoardReg(UserCreationForm,ProfileEdit):
def save(self, commit=True):
logging.debug('Save form2 '+str(commit));
user = super(BoardReg, self).save()
if(commit):
pr = BModels.profile(name=self.cleaned_data['display_name'],user=user,location=self.cleaned_data['location'],to_contact=self.cleaned_data['to_contact'],how_contact=self.cleaned_data['how_contact'],def_tags=self.cleaned_data['def_tags'],email=self.cleaned_data['email'],send_emails=self.cleaned_data['send_emails']);
pr.save();
return user
Django
Exception Type: TypeError
Exception Value:
Error when calling the metaclass bases
metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
Exception Location: /usr/lib/python2.5/site-packages/django/forms/models.py in __new__, line 170
Python Executable: /usr/bin/python
Python Version: 2.5.2