Buddy,

I found this, you might give it a try.

http://www.djangosnippets.org/snippets/703/

Graham

On Nov 28, 9:59 am, Buddy <[EMAIL PROTECTED]> wrote:
> Yes, I try it before to my ask here. I get error if use likethis
> (class B(forms.ModelForm, A):
>
> ###
> TypeError at /A/
>
> 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
>
> Request Method:         GET
> Request URL:    http://127.0.0.1:8000/A/
> 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
> #####
>
> On 28 нояб, 18:39, Daniel Roseman <[EMAIL PROTECTED]>
> wrote:
>
> > On Nov 28, 3:47 pm, Buddy <[EMAIL PROTECTED]> wrote:
>
> > > I have model:
>
> > > class A(forms.Form):
> > >     p1 = forms.CharField()
> > >     p2 = forms.CharField()
>
> > > class B(A):
> > >     class Meta:
> > >         model = User
> > >         fields = ('username', 'email', 'first_name', 'last_name',)
>
> > >http://dpaste.com/94378/
>
> > > but fields that define in class B not apears when I render it in html.
> > > Why is it not apears?
>
> > Because neither A nor B are ModelForms. You could make B inherit from
> > both ModelForm and A - untested, but should work:
>
> > class B(forms.ModelForm, A):
> >    ... etc
>
> > > PS
> > > Whether exist class'' tree in any a form for common observe?
>
> > Sorry, no idea what you're asking here.
>
> > --
> > DR.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to