|
|
|
|
@ -108,7 +108,8 @@ class ProspectAdmin(SyncedObjectAdmin): |
|
|
|
|
'fields': ['related_activities', 'id', 'entity_names', 'first_name', 'last_name', 'email', 'phone', 'official_user', 'name_unsure', 'entities', 'related_user'] |
|
|
|
|
}), |
|
|
|
|
] |
|
|
|
|
list_display = ('entity_names', 'first_name', 'last_name', 'last_update', 'current_status', 'current_text') |
|
|
|
|
list_display = ('first_name', 'last_name', 'entity_names', 'last_update_date', 'current_status', 'current_text') |
|
|
|
|
|
|
|
|
|
list_filter = (ProspectStatusFilter, ProspectDeclineReasonFilter, 'creation_date', StaffUserFilter, 'source', ProspectProfileFilter) |
|
|
|
|
search_fields = ('first_name', 'last_name', 'email', 'entities__name') |
|
|
|
|
date_hierarchy = 'creation_date' |
|
|
|
|
@ -118,6 +119,11 @@ class ProspectAdmin(SyncedObjectAdmin): |
|
|
|
|
actions = ['send_email', create_activity_for_prospect, mark_as_inbound, contacted_by_sms, mark_as_should_test, mark_as_testing, mark_as_customer, declined_too_expensive, declined_use_something_else] |
|
|
|
|
raw_id_fields = ['official_user'] |
|
|
|
|
|
|
|
|
|
def last_update_date(self, obj): |
|
|
|
|
return obj.last_update.date() if obj.last_update else None |
|
|
|
|
last_update_date.short_description = 'Last Update' |
|
|
|
|
last_update_date.admin_order_field = 'last_update' |
|
|
|
|
|
|
|
|
|
def related_activities(self, obj): |
|
|
|
|
activities = obj.activities.all() |
|
|
|
|
if activities: |
|
|
|
|
|