tolomea / django-data-browser

Django app for user friendly querying of Django models
BSD 3-Clause "New" or "Revised" License
350 stars 28 forks source link

Date filter incorrect #27

Closed bb4L closed 3 years ago

bb4L commented 3 years ago

When excluding a specific year for a date, it also excludes Null.

( date => year not equals ...)

tolomea commented 3 years ago

fun, fun, decent odds this is Django weirdness, what you describe is normal SQL behaviour, Django generally tries to cover over that sort of thing, when I get a moment I will dig into it and see if I can confirm and fix / work around

bb4L commented 3 years ago

when I get a moment I will dig into it and see if I can confirm and fix / work around

That would be perfect (especially the work around)

tolomea commented 3 years ago

Work arounds for Django stuff are an interesting policy decision

I tend to think about two Data Browser user bases

1: the dev's (like you) who install the Data Browser into Django sites and so are crucial to adoption, it is for this group that I'm willing to entertain the rebranding stuff, if someone doesn't install it because of branding that's an adoption loss

2: dev's aside I view the actual end user base as non technical business people, people who should not need to know stuff like Q(bob__fred=None) and Q(bob__fred__isnull=True) don't always return the same result when bob is a json field, for this group I would like to fix something like this even if it turns out to be known Django behaviour (like the json thing is)

tolomea commented 3 years ago

FYI: https://code.djangoproject.com/ticket/32398#ticket I'm still intending to try and work around this in the Data browser, essentially by manually specifying the null clause.