Skip to content

Is this a small error in the README file? #17

Description

@ramiro

First of all, this project is a great idea. Thanks!

From https://github.com/akaariai/django-reverse-unique/blame/f0dd7c01ae8ed6193a7ee26b7f4e4195ae42dadd/README.rst#L59-L60

current_salary = models.ReverseUnique(
    "EmployeeSalary",
    filter=Q(valid_from__gte=datetime.now) &
           (Q(valid_until__isnull=True) | Q(valid_until__lte=datetime.now))
)

aren't the valid_from and valid_until filters swapped so we can actually an employee's current salary?

current_salary = models.ReverseUnique(
    "EmployeeSalary",
    filter=Q(valid_from__lte=datetime.now) &
           (Q(valid_until__isnull=True) | Q(valid_until__gte=datetime.now))
)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions