admin.py 522 Bytes
Newer Older
1
from django.contrib import admin
2

3
from picampaign.contact.models import Contact, Phone
4

okhin's avatar
okhin committed
5 6 7
class InlinePhone(admin.TabularInline):
    model = Phone

8
class ContactAdmin(admin.ModelAdmin):
okhin's avatar
okhin committed
9
    inlines = [InlinePhone]
10
    list_display = ['full_name', 'mail', 'twitter', 'phone']
11 12
    search_fields = ('first_name', 'last_name')

13 14 15
class PhoneAdmin(admin.ModelAdmin):
    list_display = ['phone', 'valid', 'contact']
    search_fields = ('phone',)
16

17
admin.site.register(Phone, PhoneAdmin)
18
admin.site.register(Contact, ContactAdmin)