|
|
|
@ -11,6 +11,7 @@ from sync.models import BaseModel |
|
|
|
User = get_user_model() |
|
|
|
User = get_user_model() |
|
|
|
|
|
|
|
|
|
|
|
class Status(models.TextChoices): |
|
|
|
class Status(models.TextChoices): |
|
|
|
|
|
|
|
NONE = 'NONE', 'None' |
|
|
|
CONTACTED = 'CONTACTED', 'Contacted' |
|
|
|
CONTACTED = 'CONTACTED', 'Contacted' |
|
|
|
RESPONDED = 'RESPONDED', 'Responded' |
|
|
|
RESPONDED = 'RESPONDED', 'Responded' |
|
|
|
SHOULD_TEST = 'SHOULD_TEST', 'Should test' |
|
|
|
SHOULD_TEST = 'SHOULD_TEST', 'Should test' |
|
|
|
@ -73,7 +74,7 @@ class Prospect(BaseModel): |
|
|
|
last_activity = self.activities.exclude(status=None).order_by('-creation_date').first() |
|
|
|
last_activity = self.activities.exclude(status=None).order_by('-creation_date').first() |
|
|
|
if last_activity: |
|
|
|
if last_activity: |
|
|
|
return last_activity.status |
|
|
|
return last_activity.status |
|
|
|
return None |
|
|
|
return Status.NONE |
|
|
|
|
|
|
|
|
|
|
|
def current_declination_reason(self): |
|
|
|
def current_declination_reason(self): |
|
|
|
last_activity = self.activities.exclude(status=None).order_by('-creation_date').first() |
|
|
|
last_activity = self.activities.exclude(status=None).order_by('-creation_date').first() |
|
|
|
@ -113,10 +114,6 @@ class Activity(BaseModel): |
|
|
|
class Meta: |
|
|
|
class Meta: |
|
|
|
verbose_name_plural = "Activities" |
|
|
|
verbose_name_plural = "Activities" |
|
|
|
ordering = ['-creation_date'] |
|
|
|
ordering = ['-creation_date'] |
|
|
|
# permissions = [ |
|
|
|
|
|
|
|
# ("manage_events", "Can manage events"), |
|
|
|
|
|
|
|
# ("view_events", "Can view events"), |
|
|
|
|
|
|
|
# ] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# def __str__(self): |
|
|
|
# def __str__(self): |
|
|
|
# return f"{self.get_type_display()} - {self.creation_date.date()}" |
|
|
|
# return f"{self.get_type_display()} - {self.creation_date.date()}" |
|
|
|
|