Skip to content

Commit

Permalink
TimelineEntry Meta duplication fix
Browse files Browse the repository at this point in the history
  • Loading branch information
f213 committed Dec 29, 2016
1 parent 4aac814 commit abd7065
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
18 changes: 18 additions & 0 deletions timeline/migrations/0012_ordering.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('timeline', '0011_unique_lesson_type'),
]

operations = [
migrations.AlterModelOptions(
name='entry',
options={'permissions': (('other_entries', "Can work with other's timeleine entries"),), 'verbose_name': 'Planned class', 'verbose_name_plural': 'Planned classes', 'ordering': ['start']},
),
]
14 changes: 6 additions & 8 deletions timeline/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ class Entry(models.Model):

class Meta:
ordering = ['start']
unique_together = ['teacher', 'lesson_type', 'start']
verbose_name = 'Planned class'
verbose_name_plural = 'Planned classes'
permissions = (
('other_entries', "Can work with other's timeleine entries"),
)

@property
def is_free(self):
Expand All @@ -220,14 +226,6 @@ def get_step2_url(self):
'time': format(start_time, 'H:i')
})

class Meta:
unique_together = ('teacher', 'lesson_type', 'start')
verbose_name = 'Planned class'
verbose_name_plural = 'Planned classes'
permissions = (
('other_entries', "Can work with other's timeleine entries"),
)

def __str__(self):
"""
Event title for the teacher
Expand Down

0 comments on commit abd7065

Please sign in to comment.