Re: default values on database level

2018-03-29 Thread Paul Tiplady
Closing the loop here -- Tim just reopened https://code.djangoproject.com/ticket/470. This feature would also be useful for achieving zero-downtime migrations, as discussed in https://code.djangoproject.com/ticket/29266. Sounds like the design has mostly been agreed -- would a PR be accepted

Setting defaults in the DB to support zero-downtime migrations

2018-03-22 Thread Paul Tiplady
It can be quite fiddly to support zero-downtime DB migrations in Django. For example see https://dev.mysql.com/doc/refman/5.7/en/data-type-defaults.html for tricks in Postgres; I'll refer to MySQL herein. In general the sequence is to first upgrade the DB schema to the new version, while

Re: Proposal: local timezone-aware datetime fields in the admin site

2018-10-04 Thread Paul Tiplady
ime zone name) and whether it's locale-dependent (that would be a mess). > > If this API reliably returns a timezone name that pytz understands, then > you should be able to achieve your goal in the Widget for datetime fields > and to preserve backwards-compatibility. > > Best r

Proposal: local timezone-aware datetime fields in the admin site

2018-10-03 Thread Paul Tiplady
Timezone handling in the Django admin is quite confusing for users when the users are in multiple timezones, because everything in the admin site operates in the server's time. Assuming USE_TZ=True, TIME_ZONE='UTC', USE_I18N, USE_L10N, when viewing a datetime field, users see the UTC time,