Good afternoon guys, I'm good, a doubt! I'm using 2 Apps in django admin
App1 = Registration
App2 = Controllers control
I imported the app1 model, the "Person" class into the "Scholarship" class, but it only takes the "Name" attribute and I can only list the name in Display_list in admin.py app2.
Can I list the other attributes of the "Person" class, such as address or child_date in the display_list in my App2 (Player Control) ?? and how do I do that?
Who can help me, I thank you from now on!
registrations / models.py
class Pessoa(models.Model):
CPF = models.CharField(primary_key = True, max_length = 11)
Nome = models.CharField(max_length= 45)
Data_nascimento = models.DateField()
Endereço = models.CharField(max_length=45)
def __str__(self):
return "%s" % (self.Nome)
players control / models.py
from django.db import models
from ..cadastros.models import Pessoa
class Bolsista(models.Model):
pessoa = models.ForeignKey("cadastros.Pessoa")
def __unicode__(self):
return 'Bolsista:' + self.pessoa
Players control / admin.py
from django.contrib import admin
from gestaobolsistas.controledebolsistas.models import Bolsista
class BolsistaAdmin(admin.ModelAdmin):
model=Bolsista
list_display = ['pessoa']
search_fields = ['pessoa']
admin.site.register(Bolsista, BolsistaAdmin)