Re: [Django] #34188: Add a section on refresh_from_db to the Multiple databases documentation

2022-11-29 Thread Django
#34188: Add a section on refresh_from_db to the Multiple databases documentation
---+--
 Reporter:  martinmain93   |Owner:  Leo Tom
 Type:  Uncategorized  |   Status:  closed
Component:  Documentation  |  Version:  4.1
 Severity:  Normal |   Resolution:  wontfix
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  1  |UI/UX:  0
---+--
Changes (by Carlton Gibson):

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


Comment:

 I think this is already covered by the note in the
 
[https://docs.djangoproject.com/en/4.1/ref/models/instances/#django.db.models.Model.refresh_from_db
 refresh_from_db docs]:

 > The reloading happens from the database the instance was loaded from, or
 from the default database if the instance wasn’t loaded from the database.
 The `using` argument can be used to force the database used for reloading.

-- 
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/01070184c2dad93d-06194c91-4625-4691-8a8e-9a97884c255a-00%40eu-central-1.amazonses.com.


Re: [Django] #34188: Add a section on refresh_from_db to the Multiple databases documentation

2022-11-29 Thread Django
#34188: Add a section on refresh_from_db to the Multiple databases documentation
---+--
 Reporter:  martinmain93   |Owner:  Leo Tom
 Type:  Uncategorized  |   Status:  assigned
Component:  Documentation  |  Version:  4.1
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  1  |UI/UX:  0
---+--
Changes (by Leo Tom):

 * owner:  nobody => Leo Tom
 * 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/01070184c2998003-685d4897-5a2c-4656-9e3b-bc9af65f7c1b-00%40eu-central-1.amazonses.com.


[Django] #34188: Add a section on refresh_from_db to the Multiple databases documentation

2022-11-28 Thread Django
#34188: Add a section on refresh_from_db to the Multiple databases documentation
-+
   Reporter:  martinmain93   |  Owner:  nobody
   Type:  Uncategorized  | Status:  new
  Component:  Documentation  |Version:  4.1
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  1
  UI/UX:  0  |
-+
 I've recently implemented multiple databases in a project using a read-
 replica setup, and everything went quite smoothly. The docs (
 https://docs.djangoproject.com/en/4.1/topics/db/multi-db/) were helpful to
 set up a simple database router and the appropriate config changes. One of
 the first big issues I ran into was that I quickly ran into errors any
 time in the app that `refresh_from_db` was being used. Because of the
 nature of the command, it's usually being issued when some action was
 committed and I want to get the latest data from the database. Of course
 this is going to be an issue with multiple databases. With some digging, I
 discovered that you can indeed use `refresh_from_db(using=db)` to select
 the default database. This quickly solved the issue.

 I think it would be very useful to anyone setting up a multi db setup to
 have a short section on the Multiple Databases docs that includes this
 information.

-- 
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/01070184c062cec5-29c5fa17-fb11-43a8-8920-016c9c5dc963-00%40eu-central-1.amazonses.com.