On 18 April 2013 10:10, cha <[email protected]> wrote:
> Hello how are you

Great, thanks for asking!

> I want to explain to me what is **"Model Managers"**  in django ??? and What
> are the useful ?

They are a different way of collecting querysets of objects. Have you
read the documentation to this end?

https://docs.djangoproject.com/en/1.5/topics/db/managers/
https://docs.djangoproject.com/en/dev/topics/db/managers/


For instance, on my last project I had "students, subjects, courses, grades"

I wanted to be able to call some aspects of those quickly without
writing out the whole filter every time. So I created some filters
like these:

Male students in Accounting under 25 years   as Student.men_account_25.all()
Male students in Accounting over 25 years     as Student.men_account_26.all()
Female students in Accounting under 25 years as Student.women_account_25.all()
Female students in Accounting over 25 years as Student.women_account_25.all()

I could have gone very deep:

Male students in Accounting over 25 years that passed last semester
and are from province X.

I then added a .count() to the end of the call, and I had instant
enrollment statistics that were always up-to-date.

Does that clear it up for you?

cheers
L.



--
The new creativity is pointing, not making. Likewise, in the future,
the best writers will be the best information managers.

http://www.theawl.com/2013/02/an-interview-with-avant-garde-poet-kenneth-goldsmith

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to