Re: [Django] #31382: Silent failure when saving non-concrete field with update_fields

2020-08-12 Thread Django
#31382: Silent failure when saving non-concrete field with update_fields
-+-
 Reporter:  Peter Law|Owner:  Pat
 |  Garcia
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 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 Mariusz Felisiak ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"8954f255bbf5f4ee997fd6de62cb50fc9b5dd697" 8954f255]:
 {{{
 #!CommitTicketReference repository=""
 revision="8954f255bbf5f4ee997fd6de62cb50fc9b5dd697"
 Fixed #31382 -- Made Model.save(update_fields=...) raise ValueError on
 non-concrete fields.
 }}}

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.7734c12e1e2ae944d106b3aaa800b29a%40djangoproject.com.


Re: [Django] #31382: Silent failure when saving non-concrete field with update_fields

2020-08-11 Thread Django
#31382: Silent failure when saving non-concrete field with update_fields
-+-
 Reporter:  Peter Law|Owner:  Pat
 |  Garcia
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 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 felixxm):

 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/13295 PR]

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.01364ca60aee34a4a83a2ac971f14952%40djangoproject.com.


Re: [Django] #31382: Silent failure when saving non-concrete field with update_fields

2020-07-20 Thread Django
#31382: Silent failure when saving non-concrete field with update_fields
-+-
 Reporter:  Peter Law|Owner:  Pat
 |  Garcia
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 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 Pat Garcia):

 Started working on a fix, should have a PR ready soonish

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.433e5140fe2129baf3c0f3de712ec50f%40djangoproject.com.


Re: [Django] #31382: Silent failure when saving non-concrete field with update_fields

2020-07-01 Thread Django
#31382: Silent failure when saving non-concrete field with update_fields
-+-
 Reporter:  Peter Law|Owner:  patgarcia
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 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
-+-
Changes (by patgarcia):

 * owner:  nobody => patgarcia
 * status:  new => assigned


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.5d31d07970f8e1a78fec5ac568d94d8d%40djangoproject.com.


Re: [Django] #31382: Silent failure when saving non-concrete field with update_fields

2020-04-05 Thread Django
#31382: Silent failure when saving non-concrete field with update_fields
-+-
 Reporter:  Peter Law|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 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 Sanskar Jaiswal):

 Replying to [ticket:31382 Peter Law]:
 > If you have a non-concrete field which wraps a couple of concrete fields
 (a bit like `GenericForeignKey`, though my codebase doesn't uses this for
 compound data types rather than relations), then when you pass the name of
 that non-concrete field to
 `save(update_fields=('my_non_concrete_field',))`, the model will be saved
 '''without''' saving that field and yet no error will be emitted.

 Hey Peter,
 Could you kindly provide a minimal code sample so that I can successfully
 reproduce this error on my machine?

 Thanks
 Sanskar

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.f13f3603f654eb89a15f25afddaf99e7%40djangoproject.com.


Re: [Django] #31382: Silent failure when saving non-concrete field with update_fields

2020-03-19 Thread Django
#31382: Silent failure when saving non-concrete field with update_fields
-+-
 Reporter:  Peter Law|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 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
-+-
Changes (by Simon Charette):

 * type:  Uncategorized => Bug
 * version:  2.2 => master
 * component:  Uncategorized => Database layer (models, ORM)
 * stage:  Unreviewed => Accepted


Comment:

 > Ideally, I would like a way for a non-concrete field to be able to
 specify the underlying concrete fields which should be saved on its
 behalf. That's clearly rather complex though (and would likely have
 impacts beyond just update_fields) -- a simpler solution would be to error
 about this case so that the developer knows something is amis.

 Completely agree with this premise, let's focus this ticket on addressing
 the concrete field discrepancy. A later improvement could be to allow
 specifying ''virtual'' update fields as aliases to the field they manage
 but that should be tackled in another ticket.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.59ce86282b9dbf2de506a13413e2e0be%40djangoproject.com.


Re: [Django] #31382: Silent failure when saving non-concrete field with update_fields

2020-03-19 Thread Django
#31382: Silent failure when saving non-concrete field with update_fields
---+--
 Reporter:  Peter Law  |Owner:  nobody
 Type:  Uncategorized  |   Status:  new
Component:  Uncategorized  |  Version:  2.2
 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
---+--

Comment (by Peter Law):

 Just to add for anyone who has a similar issue -- I'm currently working
 around this by having my field listen for the `pre_save` signal as part of
 its `contribute_to_class` method and having the signal emit an exception
 which prevents the save going through.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.b5bba7aa9f21f22ec3176e46d1fa2554%40djangoproject.com.


[Django] #31382: Silent failure when saving non-concrete field with update_fields

2020-03-19 Thread Django
#31382: Silent failure when saving non-concrete field with update_fields
-+
   Reporter:  Peter Law  |  Owner:  nobody
   Type:  Uncategorized  | Status:  new
  Component:  Uncategorized  |Version:  2.2
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+
 If you have a non-concrete field which wraps a couple of concrete fields
 (a bit like `GenericForeignKey`, though my codebase doesn't uses this for
 compound data types rather than relations), then when you pass the name of
 that non-concrete field to
 `save(update_fields=('my_non_concrete_field',))`, the model will be saved
 '''without''' saving that field and yet no error will be emitted.

 I think that this could be because the check for the validity of the
 `update_fields` is done against `meta.fields`
 
(https://github.com/django/django/blob/5c8441a0b8787c14b45fb761550571baea48604e/django/db/models/base.py#L714-L737)
 while the later check for which fields to actually save is done using
 `meta.local_concrete_fields`
 
(https://github.com/django/django/blob/5c8441a0b8787c14b45fb761550571baea48604e/django/db/models/base.py#L838-L844).

 Ideally, I would like a way for a non-concrete field to be able to specify
 the underlying concrete fields which should be saved on its behalf. That's
 clearly rather complex though (and would likely have impacts beyond just
 `update_fields`) -- a simpler solution would be to error about this case
 so that the developer knows something is amis.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.e9405fba1be377b36847d402b0c3a6fa%40djangoproject.com.