forked from rc/aircox
fix bug for nth week and one on two; enum Schedule.Frequency
This commit is contained in:
@ -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.
|
||||
"""
|
||||
|
@ -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
|
||||
|
@ -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):
|
||||
|
Reference in New Issue
Block a user