Задать вопрос

Тел: +7 965 3737 888

431

Просмотров

4

Ответов

Easier custom Model Manager Chaining

A zero-boilerplate generalisation of http://djangosnippets.org/snippets/2114/

Вопрос полезен? Да0/Нет0
file_4203.py(3.1Кб)
None

Ответы (4):

Ответ7times9:26.07.2010
Ответ полезен? Да0/Нет0

Sorry, please ignore my comment above.

It's clever how you can pass in a function or a class :-)

Ответ7times9:26.07.2010
Ответ полезен? Да0/Нет0

Indentation of lines 67 & 68 needs a tab to the right?

Ответgsakkis:21.07.2010
Ответ полезен? Да0/Нет0

2010-07-22: Fixed bug that was effectively ignoring the get_query_set of a passed custom manager. Now the parent get_query_set is honored, unless there is a conflict between the type of the returned queryset and the dynamically generated QuerySet subclass, in which case a TypeError is raised.

Ответgsakkis:21.07.2010
Ответ полезен? Да0/Нет0

@carljm, no it's not released anywhere; feel free to include it in your project with proper attribution.