Skip to content

Commit

Permalink
Merge pull request #39 from ambitioninc/develop
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
travistruett committed Nov 10, 2016
2 parents 24bc86a + 7055f56 commit 692ebb8
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 9 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ env:
global:
- DB=postgres
matrix:
- DJANGO=">=1.7,<1.8"
- DJANGO=">=1.8,<1.9"
- DJANGO=">=1.9,<1.10"
install:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-11-08 21:17
from __future__ import unicode_literals

import datetime
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('localized_recurrence', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='localizedrecurrence',
name='offset2',
field=models.DurationField(default=datetime.timedelta(0)),
),
]
24 changes: 24 additions & 0 deletions localized_recurrence/migrations/0003_offset_data_migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals

from datetime import timedelta
from django.db import migrations


def migrate_integers_to_intervals(apps, schema_editor):
# Migrate custom DurationField values to Django's Native DurationField values
LocalizedRecurrence = apps.get_model('localized_recurrence', 'LocalizedRecurrence')
for lr in LocalizedRecurrence.objects.all():
lr.offset2 = lr.offset
lr.save()


class Migration(migrations.Migration):
dependencies = [
('localized_recurrence', '0002_localizedrecurrence_offset2'),
]

operations = [
migrations.RunPython(migrate_integers_to_intervals),
]
25 changes: 25 additions & 0 deletions localized_recurrence/migrations/0004_auto_20161108_2151.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-11-08 21:51
from __future__ import unicode_literals

import datetime
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('localized_recurrence', '0003_offset_data_migration'),
]

operations = [
migrations.RemoveField(
model_name='localizedrecurrence',
name='offset',
),
migrations.RenameField(
model_name='localizedrecurrence',
old_name='offset2',
new_name='offset',
),
]
4 changes: 1 addition & 3 deletions localized_recurrence/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import fleming
import pytz

from .fields import DurationField


INTERVAL_CHOICES = (
('DAY', 'Day'),
Expand Down Expand Up @@ -123,7 +121,7 @@ class LocalizedRecurrence(models.Model):
"""
interval = models.CharField(max_length=18, default='DAY', choices=INTERVAL_CHOICES)
offset = DurationField(default=timedelta(0))
offset = models.DurationField(default=timedelta(0))
timezone = TimeZoneField(default='UTC')
previous_scheduled = models.DateTimeField(default=datetime(1970, 1, 1))
next_scheduled = models.DateTimeField(default=datetime(1970, 1, 1))
Expand Down
2 changes: 1 addition & 1 deletion localized_recurrence/tests/models_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_update_timezone(self):

def test_update_offset(self):
lr = G(LocalizedRecurrence)
lr.update(offset=1)
lr.update(offset=timedelta(seconds=1))
lr = LocalizedRecurrence.objects.get(id=lr.id)
self.assertEqual(lr.offset, timedelta(seconds=1))

Expand Down
2 changes: 1 addition & 1 deletion localized_recurrence/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.3.1'
__version__ = '2.0.0'
1 change: 0 additions & 1 deletion settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,5 @@ def configure_settings():
'localized_recurrence',
'localized_recurrence.tests',
),
ROOT_URLCONF='localized_recurrence.urls',
DEBUG=False,
)
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def get_version():
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 1.7',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Intended Audience :: Developers',
Expand All @@ -43,7 +42,7 @@ def get_version():
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
install_requires=[
'Django>=1.7',
'Django>=1.8,<1.10',
'django-timezone-field<2.0',
'fleming>=0.4.3',
'python-dateutil',
Expand Down

0 comments on commit 692ebb8

Please sign in to comment.