ticket 28404

134 views
Skip to first unread message

Georgiy Nazarov

unread,
Nov 4, 2017, 1:01:22 PM11/4/17
to Django developers (Contributions to Django itself)
Hello!

Was there any consensus does ticket 28404 need to be fixed? And how should it be fixed, just by showing empty_value_display in case of empty (not None) string or by separating cases of empty and None values?

--
Georgiy Nazarov

Tim Graham

unread,
Nov 4, 2017, 6:38:33 PM11/4/17
to Django developers (Contributions to Django itself)
No, there hasn't been any discussion about it. Do you have a use case for solving the ticket that might inform the decision?

Georgiy Nazarov

unread,
Nov 5, 2017, 1:43:59 PM11/5/17
to Django developers (Contributions to Django itself)
I think that working with empty strings in the same way as with None and other empty values may be useful, for example, when somebody works with models not neatly, like beginners. But on the other hand, it may be useful in some situations to separate empty strings and None (like as Mark Koh had written in comments to ticket).

воскресенье, 5 ноября 2017 г., 1:38:33 UTC+3 пользователь Tim Graham написал:

Carlton Gibson

unread,
Feb 7, 2018, 5:30:56 AM2/7/18
to Django developers (Contributions to Django itself)
[Better Subject] Fix admin change list display of empty string values. 

I'll summarise; I'd like to elicit any objections. 

The issue is that the admin change list doesn't display the "empty value" placeholder for empty strings, 
which is the recommended way of handling "nullable" CharFields. 

The image attached to the issue demonstrates the issue nicely: 


These rows won't even be clickable. 

Options: 

1. Make the existing admin `empty_value_display` option also handle empty strings. 
2. Add a new admin option for empty strings, separate from `None` (null=True) cases. 

We have PR that's not too far off for option 1. 

More to the point I'm in favour of option 1 because: 

* We have enough admin options already
* The empty string is just how text-type fields handle the `null` case. (i.e. this should already be the behaviour.)

Are there any reasons we can't adjust `empty_value_display` to also be used for empty strings?


Thanks for the input all!

Kind Regards,

Carlton





Collin Anderson

unread,
Feb 7, 2018, 1:23:13 PM2/7/18
to django-d...@googlegroups.com
Hi Carlton,

There are some cases where I really do want an empty string displayed (though not in a linked column). Maybe only use it only when it's an auto-linked field/column? Or maybe only use this behavior in display_for_field()? (So if you use a custom function/method, you can still have full control.)

Thanks,
Collin


--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/92b12dbc-ace6-4d72-9234-5563625446b2%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Carlton Gibson

unread,
Feb 8, 2018, 3:13:08 AM2/8/18
to Django developers (Contributions to Django itself)
Hi Collin, 

Thanks. That's perfect. 👍

Regards,

Carlton
Reply all
Reply to author
Forward
0 new messages