fix bug for nth week and one on two; enum Schedule.Frequency

This commit is contained in:
bkfox
2016-06-28 17:27:47 +02:00
parent bae670e883
commit fe87e0be99
7 changed files with 51 additions and 38 deletions

View File

@ -18,8 +18,8 @@ from aircox.cms import settings
class Routable:
@classmethod
def get_with_thread(cl, thread = None, queryset = None,
thread_model = None, thread_id = None):
def get_siblings(cl, thread = None, queryset = None,
thread_model = None, thread_id = None):
"""
Return posts of the cl's type that are children of the given thread.
"""

View File

@ -5,8 +5,6 @@ import heapq
from django.utils.translation import ugettext as _, ugettext_lazy
from django.db.models.query import QuerySet
from aircox.cms.models import Routable
class QCombine:
"""
@ -126,7 +124,7 @@ class Manager(type):
return qs
class GenericModel(Routable,metaclass=Manager):
class GenericModel(metaclass=Manager):
"""
This class is used to register a route for multiple models to a website.
A QCombine is created with qs for all given models when objects

View File

@ -126,7 +126,7 @@ class ThreadRoute(Route):
@classmethod
def get_queryset(cl, model, request, thread_model, pk, **kwargs):
thread = cl.get_thread(model, thread_model, pk)
return model.get_with_thread(thread_model = thread, thread_id = pk)
return model.get_siblings(thread_model = thread, thread_id = pk)
@classmethod
def get_title(cl, model, request, thread_model, pk, **kwargs):