mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-16 20:00:23 +00:00
make tests compatible with pre-1.2
This commit is contained in:
parent
5da38ee0c6
commit
1d4613e807
1 changed files with 4 additions and 1 deletions
|
|
@ -88,7 +88,10 @@ class ByAuthorQuerySet(models.query.QuerySet, AuthorMixin):
|
|||
|
||||
class FeaturedManager(models.Manager):
|
||||
def get_query_set(self):
|
||||
return ByAuthorQuerySet(self.model, using=self._db).filter(feature=True)
|
||||
kwargs = {}
|
||||
if hasattr(self, '_db'):
|
||||
kwargs['using'] = self._db
|
||||
return ByAuthorQuerySet(self.model, **kwargs).filter(feature=True)
|
||||
|
||||
class Entry(models.Model):
|
||||
author = models.CharField(max_length=20)
|
||||
|
|
|
|||
Loading…
Reference in a new issue