django-relativedelta icon indicating copy to clipboard operation
django-relativedelta copied to clipboard

Feature:support alter relativedelta field on admin

Open ChandlerBent opened this issue 6 years ago • 5 comments

Hi

I am looking for the relativedelta field and want to use on admin. Then found it that solve what I want. Bug it doesn't support alter on admin. So I do some modify to support admin.

ChandlerBent avatar May 22 '19 09:05 ChandlerBent

Please don't change indentation of existing code. This causes your patch to be larger than necessary and makes it hard to review. Ideally, you should configure your editor to accept editorconfig configuration, that would've prevented that in the first place.

Can you rebase your patch such that it doesn't create so large a change?

sjamaan avatar May 22 '19 09:05 sjamaan

It's done.

ChandlerBent avatar May 22 '19 09:05 ChandlerBent

Thanks for the quick turnaround! I'll add a test app which will make it easier for me to test your code and get back to you (might take a couple of work days).

sjamaan avatar May 22 '19 10:05 sjamaan

Sorry for the delay. I finally got around to this. Your code works, but I think it's a bit confusing, it looks more like a date and time stamp input (point in time) than a relative delta input (period of time). Especially due to the way time is separated from the years, days, months. Could you change this a bit to make it clearer that this is for interval of time rather than a specific point in time?

sjamaan avatar Jun 12 '19 09:06 sjamaan

I will think about that how to change it and make it be real relative delta input. But Django DurationField is TextInput. I think other developer will set clear verbose_name and help_text for administrator to use.

Anyway, make it more easy and friendly for other developer to use is right.

ChandlerBent avatar Jun 19 '19 11:06 ChandlerBent