-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TimeZoneMixin #143
base: master
Are you sure you want to change the base?
Add TimeZoneMixin #143
Conversation
Add test settings file too.
Conflicts: CHANGELOG.md
@kevinetienne Review? |
Did you add |
Yes - it allows creating test migrations much more easily. |
@@ -55,6 +56,13 @@ class Meta: | |||
abstract = True | |||
|
|||
|
|||
class TimeZoneMixin(models.Model): | |||
timezone = models.CharField(max_length=255, default=settings.TIME_ZONE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would be safer to define another setting? It looks like TIME_ZONE
could be set to None
see https://docs.djangoproject.com/en/1.8/ref/settings/#time-zone
Use `pytz.common_timezones` to allow simple updates if timezones change.
@kevinetienne @meshy Updated. |
continent, _sep, town = timezone.partition('/') | ||
choices[continent].append((timezone, town)) | ||
|
||
return tuple((c, tuple(t)) for c, t in choices.items()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, I wasn't aware django could deal with grouped choices
No description provided.