In Django admin I want to override and implement my own form for a model (e.g. Invoice model).
I want the invoice form to have auto-fill fields for customer name, pr
How to override a form in the django admin according to the docs:
from django import forms
from django.contrib import admin
from myapp.models import Person
class PersonForm(forms.ModelForm):
class Meta:
model = Person
exclude = ['name']
class PersonAdmin(admin.ModelAdmin):
exclude = ['age']
form = PersonForm