Задать вопрос

Тел: +7 965 3737 888

516

Просмотров

0

Ответов

Forcing DB on relationship manager with multiple database project

<p>I have a master/slave SQL setup and sometimes I need to access the data immediately after write, but the data has not yet propagated to the slave yet.</p>
<p>This forces me to require .using('default') every time that relationship is accessed. Ex:
    self.books.using('default').all().delete()</p>
<p>Setting objects = ForceDefaultDBManager() on the related object removes this requirement throughout your code. This now does the same as the last example:
    self.books.all().delete()</p>

Вопрос полезен? Да0/Нет0
file_4366.py(546.0б)
None