Anyone please tell me depending on choices , show to fields using admin
=== Models.py
from django.db import models
class Project(models.Model):
A = 'A'
B = 'B'
PROJECT_TYPE_CHOICES = (
(A, 'Plan Type A'),
(B, 'Plan Type B'),
)
project_type = models.CharField(max_length=100,
choices=PROJECT_TYPE_CHOICES)
name = models.CharField(max_length=500)
business = models.CharField(max_length=500)
=== admin.py
from django.contrib import admin
from .models import Project
admin.site.register(Project, ProjectAdmin)
i want if i choices A show fields name
if i choices B show fields business
Thanks