2012-02-04 4 views
0

는이 같은 전망을 :사용자 정의보기 장고 관리자

나는 'total_notes'를 클릭하고 난 그냥 내가 쓰고 싶은 만 등록

을 볼 수있는 또 다른보기로 수행해야

class VIewAdmin(admin.ModelAdmin): 
list_display = ('id', 'nome', 'cim', 'telefone', 'total_notas', 'credito', 'ativo') 

def total_notas(self, obj): 
    if obj.total_notas: 
     return '<a href="??????">%s</a>' % (obj.total_notas()) 
total_notas.allow_tags = True 

admin.site.register(Model, ViewAdmin) 

내가 그 개체 레코드만을 표시 할 수있는 관리자의 다른보기 ..

total_notes는 메모의 총계를 표시하고 작성해야하는보기에서 해당 레코드를 표시해야합니다. 어떻게하면됩니까 ?? 내 영어에 대한 유감

..

답변

0

왜 그냥 필터를 사용할 수 있습니까?

보기를 만들고 urls.py에보기를 추가하는 것이 아니라면. 그런 다음 전화 번호 :

def total_notas(self, obj): 
    return '<a href="my_view/%s">%s</a>' % (self.total_notas) 
관련 문제