Re: [Django] #16891: Delete/update should return number of rows modified

2011-10-20 Thread Django
#16891: Delete/update should return number of rows modified
-+-
 Reporter:  estebistec   |Owner:
 Type:  New feature  |  estebistec
Component:  Database layer   |   Status:  new
  (models, ORM)  |  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by estebistec):

 * has_patch:  0 => 1


Comment:

 I haven't gotten much feedback on this ticket, but what I've gotten so far
 has convinced me to back off of any changes to the base Model API.
 UpdateQuery already returned rowcounts, which means that only DeleteQuery
 needed updating. So, the patch is pretty tiny as you can see.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #16891: Delete/update should return number of rows modified

2011-10-18 Thread Django
#16891: Delete/update should return number of rows modified
-+-
 Reporter:  estebistec   |Owner:
 Type:  New feature  |  estebistec
Component:  Database layer   |   Status:  new
  (models, ORM)  |  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by estebistec):

 In case anybody is paying more attention here than on django-dev, I made
 an update to roll the changes back to just the internal query classes for
 now:

 *
 
https://github.com/estebistec/django/commit/f178b72af132dd1ba588b89fe6915f5e9ba841d0

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #16891: Delete/update should return number of rows modified

2011-10-11 Thread Django
#16891: Delete/update should return number of rows modified
-+-
 Reporter:  estebistec   |Owner:
 Type:  New feature  |  estebistec
Component:  Database layer   |   Status:  new
  (models, ORM)  |  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by akaariai):

 An idea for the save() patch: return UPDATED, INSERTED, or None instead of
 1/0. You could still do if obj.save(): (matches both UPDATED and INSERTED)
 but if need be, you could see if the object was indeed updated or
 inserted. The value would be the "outermost" value for multitable
 inherited models.

 I wonder if it would be a good idea to return the amount of deletions per
 object type when deleting? I see at least three choices:
   - Just a dict model_class -> delete count, for example in your test case
 this would be {R:1, S:2, T:2}
   - Tuple total_objects_deleted, abovementioned dict: Example: (5, {R:1,
 S:2, T:2})
   - Tuple amount_of_outer_objs, abovementioned dict: Example: (1, {R:1,
 S:2, T:2})

 To me it seems these could be useful, especially the #2 format. This
 information can be gotten nearly for free. The inconvenience here is that
 you can't do if obj.delete(): as (0, {}) isn't False. Maybe this could be
 postponed for later inclusion with kwarg with_counts=True or something. Or
 maybe there is just no use case for this.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #16891: Delete/update should return number of rows modified

2011-10-11 Thread Django
#16891: Delete/update should return number of rows modified
-+-
 Reporter:  estebistec   |Owner:
 Type:  New feature  |  estebistec
Component:  Database layer   |   Status:  new
  (models, ORM)  |  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by estebistec):

 Finally got around to these simple changes:

 *
 
https://github.com/estebistec/django/commit/b48a87afc324f5546b6654fa7638e406b397c0d6
 *
 
https://github.com/estebistec/django/commit/28ace32980b370fd17ae35019bfe8d055c673684

 If the core devs approve of these changes I can get to work on creating
 the proper patch for SVN and add doc changes.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #16891: Delete/update should return number of rows modified

2011-09-20 Thread Django
#16891: Delete/update should return number of rows modified
-+-
   Reporter: |  Owner:  estebistec
  estebistec | Status:  new
   Type:  New|  Component:  Database layer
  feature|  (models, ORM)
  Milestone: |   Severity:  Normal
Version:  1.3|   Keywords:
 Resolution: |  Has patch:  0
   Triage Stage:  Accepted   |Needs tests:  0
Needs documentation:  0  |  Easy pickings:  0
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-
Changes (by carljm):

 * component:  Uncategorized => Database layer (models, ORM)
 * type:  Uncategorized => New feature
 * stage:  Unreviewed => Accepted


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #16891: Delete/update should return number of rows modified

2011-09-20 Thread Django
#16891: Delete/update should return number of rows modified
-+---
   Reporter:  estebistec |  Owner:  estebistec
   Type:  Uncategorized  | Status:  new
  Milestone: |  Component:  Uncategorized
Version:  1.3|   Severity:  Normal
 Resolution: |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+---
Changes (by estebistec):

 * owner:  nobody => estebistec
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Claiming to work on.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



[Django] #16891: Delete/update should return number of rows modified

2011-09-20 Thread Django
#16891: Delete/update should return number of rows modified
---+---
 Reporter:  estebistec |  Owner:  nobody
 Type:  Uncategorized  | Status:  new
Milestone: |  Component:  Uncategorized
  Version:  1.3|   Severity:  Normal
 Keywords: |   Triage Stage:  Unreviewed
Has patch:  0  |  Easy pickings:  0
UI/UX:  0  |
---+---
 Splitting this off from ticket 16549...

 Deep in the bowels of django.db the rows modified value from update and
 delete queries is ignored and discarded. For reasons discussed on ticket
 16549, it would sometimes be useful to have access to that value.

 Objective of this bug is to passively return rows-modified up through the
 call-stack and, ultimately, hopefully from each of:

 * Model.save()
 * Model.delete()
 * QuerySet.update()
 * QuerySet.delete()

 with consideration for transaction control/mgmt.

 * https://code.djangoproject.com/ticket/16549

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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