Re: [Django] #26481: Add a "strict mode" for defer()/only() to prevent queries on unfetched field access

2019-10-15 Thread Django
#26481: Add a "strict mode" for defer()/only() to prevent queries on unfetched
field access
-+-
 Reporter:  Adam (Chainz)|Owner:  nobody
  Johnson|
 Type:  New feature  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:  only, defer  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * status:  new => closed
 * resolution:   => duplicate


Comment:

 Yes, it's the same ball-park certainly.

 Since #22492 is Accepted, I wonder if bringing django-seal into core is on
 your agenda Simon?

-- 
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.87e303d325ab7d79d896108b24fd1411%40djangoproject.com.


Re: [Django] #26481: Add a "strict mode" for defer()/only() to prevent queries on unfetched field access

2019-10-14 Thread Django
#26481: Add a "strict mode" for defer()/only() to prevent queries on unfetched
field access
-+-
 Reporter:  Adam (Chainz)|Owner:  nobody
  Johnson|
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  only, defer  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Simon Charette):

 This has been implemented [https://github.com/charettes/django-seal as a
 third-party application].

 Not sure if this ticket should be closed as a duplicate of #22492 like
 #30874 was.

-- 
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.46b67b7321f75c5631013d8308a38b93%40djangoproject.com.


Re: [Django] #26481: Add a "strict mode" for defer()/only() to prevent queries on unfetched field access

2016-04-22 Thread Django
#26481: Add a "strict mode" for defer()/only() to prevent queries on unfetched
field access
-+-
 Reporter:  adamchainz   |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  only, defer  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by apollo13):

 * cc: apollo13 (added)


--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.84d80ac432d5659aefb3a4913708515f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26481: Add a "strict mode" for defer()/only() to prevent queries on unfetched field access

2016-04-22 Thread Django
#26481: Add a "strict mode" for defer()/only() to prevent queries on unfetched
field access
-+-
 Reporter:  adamchainz   |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  only, defer  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by apollo13):

 Replying to [comment:3 charettes]:
 > FWIW Adrian proposed adding another keyword argument to
 `only()`/`defer()` that [https://groups.google.com/forum/#!searchin
 /django-developers/defer/django-developers/C3qoHEfeeUg/cwBNV5snQPMJ
 results in loading all fields].

 Loading all, or loading in groups as suggested by me in that thread and
 done in sqlalchemy
 (http://docs.sqlalchemy.org/en/latest/orm/loading_columns.html#deferred-
 loading-with-multiple-entities) seems like a good idea.

 > For example, we could issue a warning (`warnings.warn`) or log one
 (`logging.warning`) instead of raising an exception to prevent the code
 from crashing while exposing a way to monitor such instances.

 Since this feature would be optional for backwards compat anyways I do not
 see the need for logging.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.59fbeac106978c03487dbf71fc65c0d0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26481: Add a "strict mode" for defer()/only() to prevent queries on unfetched field access

2016-04-08 Thread Django
#26481: Add a "strict mode" for defer()/only() to prevent queries on unfetched
field access
-+-
 Reporter:  adamchainz   |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  only, defer  | 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):

 Overriding Modelrefresh_from_db allows raising failure when deferred field
 is accessed - is this enough for you use case?

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.685a07861e3fe1a34fd128e5f344e31f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26481: Add a "strict mode" for defer()/only() to prevent queries on unfetched field access

2016-04-08 Thread Django
#26481: Add a "strict mode" for defer()/only() to prevent queries on unfetched
field access
-+-
 Reporter:  adamchainz   |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  only, defer  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by charettes):

 FWIW Adrian proposed adding another keyword argument to `only()`/`defer()`
 that [https://groups.google.com/forum/#!searchin/django-developers/defer
 /django-developers/C3qoHEfeeUg/cwBNV5snQPMJ results in loading all
 fields].

 Since we might want to add different kind of actions when a deferred field
 is accessed I suggest to use another name for the kwarg.

 For example, we could issue a warning (`warnings.warn`) or log one
 (`logging.warning`) instead of raising an exception to prevent the code
 from crashing while exposing a way to monitor such instances.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.0803b36df0a57dc716ee8929f1640c01%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26481: Add a "strict mode" for defer()/only() to prevent queries on unfetched field access (was: Add a "strict mode" for defer()/only())

2016-04-08 Thread Django
#26481: Add a "strict mode" for defer()/only() to prevent queries on unfetched
field access
-+-
 Reporter:  adamchainz   |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  only, defer  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.5213c83b4e0f9947281da8cfef37de06%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.