On Fri, Aug 29, 2008 at 7:59 AM, Brot <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> At the moment I am reading the "Practical Django Projects" - Book
> written by James Bennett.
> On page 120 there is a admonition about using Default Managers. Above
> this paragraph there is the explanation about the Default Manager und
> Entry.objects.all() and Entry.live.all().
>
> It seems clear to define the live-Manager first, so it's the Default
> Manager. But I noticed that the admin interface also uses this Default
> Manager.
> If I mark an Entry as HIDDEN or DRAFT I have no possibility to take it
> LIVE with the admin interface, because the live-Default Manager don't
> return this type of entries
>
> What do you think? What's good practice in relation to the Default
> Manager?

Good practice is "whatever works", maybe "whatever works best". Since
defining the live manager first does not work it is not good practice.

What is the problem about defining the objects manager first? (Btw, nobody
said the default manager has to be called "objects". You could also do
something like this if you want to use "objects":

class Whatever(models.Model):
   ....

   all_items = models.Manager()
   objects = LiveManager()




Matthias

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to