def queryset_datetime_filter(queryset, start_date, end_date):
    """A method that appies start-date and end-date filtering to a
    database queryset.
    
    It assumes that the model field value that is being filtered via queryset is
    called 'created_on'. This method exists via convience to avoid repetition in
    filtering querysets.

    If the models in the queryset do not have a DateTime field called 'created_on'
    then this filtering will not work.

    Args:
        queryset (models.QuerySet): The django queryset that will be filtered using the 
            start and end date values.

        start_date (str|None): The start date to filter the queryset.

        end_date (str|None): The end date to filter the queryset.

    Returns:
        models.QuerySet: The queryset that has been filtered via start and end date.
    
    """
    # Applying the date time filtering:    
    if start_date is None and end_date is None:
        pass
    else:
        if end_date is None:
            queryset = queryset.filter(created_on__gt=start_date)

        if start_date is None:
            queryset = queryset.filter(created_on__lt=end_date)         

        if start_date and end_date is not None:
            queryset = queryset.filter(created_on__range=(start_date,end_date))
    
    return queryset