code: def get_active_position(self, category, name, nofallback=False):
          
          now = timezone.now()
          lookup = (Q(active_from__isnull=True) | Q(active_from__lte=now)) & \
                   (Q(active_till__isnull=True) | Q(active_till__gt=now))
  
          while True:
              try:
                  return self.get(lookup, category=category, name=name,
                      disabled=False)
              except Position.DoesNotExist:
                  # if nofallback was specified, do not look into parent categories
                  if nofallback:
                      return False
  
                  # traverse the category tree to the top otherwise
                  category = category.tree_parent
  
                  # we reached the top and still haven't found the position - return
                  if category is None:
                      return False
docs: Get active position for given position name.
  
          params:
              category - Category model to look for
              name - name of the position
              nofallback - if True than do not fall back to parent
                          category if active position is not found for category