Skip to content

Commit

Permalink
Rename MergeTaskEntry.queue => task
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankoegl committed Aug 13, 2017
1 parent cd158ef commit 98111fd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
20 changes: 20 additions & 0 deletions mygpo/maintenance/migrations/0005_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-13 08:55
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('maintenance', '0004_rename_mergetask'),
]

operations = [
migrations.RenameField(
model_name='mergetaskentry',
old_name='queue',
new_name='task',
),
]
6 changes: 3 additions & 3 deletions mygpo/maintenance/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class MergeTask(UUIDModel):

@property
def podcasts(self):
""" Returns the podcasts of the queue, sorted by subscribers """
""" Returns the podcasts of the task, sorted by subscribers """
podcasts = [entry.podcast for entry in self.entries.all()]
podcasts = sorted(podcasts,
key=lambda p: p.subscribers, reverse=True)
Expand All @@ -21,12 +21,12 @@ class MergeTaskEntry(UUIDModel):

podcast = models.ForeignKey(Podcast, on_delete=models.CASCADE)

queue = models.ForeignKey(MergeTask,
task = models.ForeignKey(MergeTask,
on_delete=models.CASCADE,
related_name='entries',
related_query_name='entry')

class Meta:
unique_together = [
['podcast', ] # a podcast can only belong to one queue
['podcast', ] # a podcast can only belong to one task
]

0 comments on commit 98111fd

Please sign in to comment.