On 7/17/07, JeffH <[EMAIL PROTECTED]> wrote:
>
> Russ: Thanks for your reply!
>
> 1. I don't consider my views-as-models approach elegant at the
> implementation level, but:

Its a bit of a nifty hack. However, I was talking more about views as
a general tool - it would be nice to support them. The success that
you have had mocking them up demonstrates that it is possible, we just
need to finess them.

> 3. That said, my delete_objects() hack was an attempt to solve the
> more general problem of using an overridden delete() without any
> special flags while allowing for the possibility of model subclassing
> in the future, because it seemed that respecting an overridden
> delete() was an important end in itself from an object integrity
> perspective.

To my mind, the better approach here would be to have proper support
for a 'read-only' query set that disables (or doesn't have) the delete
operation, rather than significantly changing the behaviour of bulk
deletes. Read-only objects/querysets would be an essential part of any
view support in Django.

> For my application, aggregate
> reporting is far more common than deletion, so it needs to be
> efficient and convenient to code.

I suppose this is the sticking point. I can see how this is a neat
hack for your specific situation, but I'm not convinced its a general
problem.

> 4. Regarding documentation, I will put in a ticket for the
> documentation on the relevant section
> http://www.djangoproject.com/documentation/model-api/#overriding-default-model-methods
> of the model-api page. That section invites people to override save()
> and delete() but only discusses save() and the implication (by
> omission) that overriding delete() is analogous is incorrect.

Well, it is correct if you consider bulk-delete to be different to
delete. There is no bulk-save analog. Bulk delete (delete on a
queryset) is quite a different operation, that doesn't integrate with
the individual object delete.

However, the distinction obviously isn't obvious to newcomers.
Suggestions on documentation improvements are always welcome. My
initial reaction is that if there is a need for improvement, its here:

http://www.djangoproject.com/documentation/db-api/#deleting-objects

> 5. A big ongoing thanks to all of Django's contributors. You rock!

No - we're more into the Gypsy jazz than the rock. But thanks anyway :-)

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
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