Skip to content

Instantly share code, notes, and snippets.

@bencleary
Created August 23, 2019 09:48
Show Gist options
  • Save bencleary/0e013de28dc1ac90580e5d215dd987d2 to your computer and use it in GitHub Desktop.
Save bencleary/0e013de28dc1ac90580e5d215dd987d2 to your computer and use it in GitHub Desktop.
from .utils import CustomerTypes
class CustomerView(DetailView):
...
def get_context_data(self, **kwargs):
...
if self.get_object().type == CustomerTypes.PROSPECT:
context["ad"] = Ad.objects.get(target=CustomerTypes.PROSPECT)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment