Hi,

How do you register the model in the admin site?
You should register your model using a ModelAdmin subclass.

Here is some docs that may help you
http://docs.djangoproject.com/en/dev/ref/contrib/admin/

The ModelForms are ment to be used in your applications rather than the
admin site.

Hope that helps

Matias.

On Fri, Dec 12, 2008 at 10:22 AM, Dennis Schmidt <metzelti...@googlemail.com
> wrote:

>
> Hello,
>
> I have a problem with ModelForms in the django admin site. I want to
> exclude some fields so they won't be displayed when I edit the model
> in the admin site. This is my code:
>
>
> class CommonInvoiceForm(forms.ModelForm):
>        price_factor = forms.ChoiceField(choices=COST_FACTOR_CHOICES)
>
>        class Meta:
>                from voipgo.accounting.invoices.models import CommonInvoice
>                model = CommonInvoice
>                exclude = ('template',)
>
>
> So as you can see I add a new field to the form - which works as
> expected. But the 'template' field I don't want to have in there is
> still displayed. 'template' is a normal ForeignKey field in the model
> declaration. What am I doing wrong here?
> >
>


-- 
:wq

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to