Top "Django-managers" questions

A Manager is the interface through which database query operations are provided to Django models.

How to Unit test with different settings in Django?

Is there any simple mechanism for overriding Django settings for a unit test? I have a manager on one of …

django settings testing django-managers
Manager isn't accessible via model instances

I'm trying to get model objects instance in another one and I raise this error : Manager isn't accessible via topic …

django django-models instance django-managers
AttributeError: 'Manager' object has no attribute 'get_by_natural_key' error in Django?

I am using Django '1.5c1'. I have this line in my settings.py: AUTH_USER_MODEL = 'fileupload.galaxyuser' …

python django django-authentication django-1.5 django-managers
Django ORM - objects.filter() vs. objects.all().filter() - which one is preferred?

Very often I see constructs like MyModel.objects.all().filter(...) which will return a QuerySet of the default Mananger. At …

python django django-queryset django-orm django-managers
Custom QuerySet and Manager without breaking DRY?

I'm trying to find a way to implement both a custom QuerySet and a custom Manager without breaking DRY. This …

django django-models django-queryset django-managers
select_related with reverse foreign keys

I have two Models in Django. The first has the hierarchy of what job functions (positions) report to which other …

django django-models django-queryset django-1.5 django-managers
How to use custom manager with related objects?

I have a custom manager. I want to use it for related objects. I found use_for_related_fields in …

django django-managers django-orm
Django custom managers - how do I return only objects created by the logged-in user?

I want to overwrite the custom objects model manager to only return objects a specific user created. Admin users should …

django django-models django-managers django-custom-manager
Django custom model managers

I'm confused about the correct way to use Django custom model managers - based on the docs you can create …

django django-models django-managers
django custom manager with filter parameter

I would like to add a custom manager which can be called from a template, but does not affect the …

django django-models django-views django-managers