Source

django-visitor-pydanny / visitor / managers.py

1
2
3
4
5
6
7
8
9
from django.db import models

class VisitorManager(models.Manager):
    
    def find_visitor(self, visitor_key):
        try:
            return self.get(visitor_key=visitor_key)
        except self.model.DoesNotExist:
            return None