On Fri, 2009-04-17 at 21:36 -0700, koranthala wrote:
[...]

> I understand it is done because all backends does not support it - but
> can it be supported for backends which actually support it? I am using
> postgresql - and now I have to do many non-optimal things to decrease
> this query count.

There is a common thread running through all your queries here that
really deserves highlighting: Django is not intended to replace using
SQL for appropriate tasks. If you have things that are easily done using
direct SQL calls and bulk inserts and delete with particular cascading
behaviour definitely fall into this area, then do just that. Use raw
SQL.

The common cases for Django are that reads are much more common than
inserts by a few orders of magnitude and inserts happen very rarely. So
single item saves are normal and easy and you can loop when you want to
save a few items at once. Django is ultimately a framework to support
applications such as web sites where bulk data creation is *not* the
norm. It's certainly possible to use Django's components independently
of each other and in varied situations, but it's not economical for the
developers or users if we were to try and generalise to all those cases.
There are already tools available (cursor.execute(...)) to do that and
it's no value-add for Django to emulate that poorly.

This isn't a cop-out or anything like that. It's a design feature.
Access to the underlying database connection and cursors is exposed
deliberately and usage is encouraged.

Regards,
Malcolm

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to