#19068: comments in a multiple database context
----------------------------------+--------------------------------------
     Reporter:  esimorre          |                    Owner:  nobody
         Type:  Bug               |                   Status:  reopened
    Component:  contrib.comments  |                  Version:
     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 esimorre):

 It is obvious that the line code below raise a "table xxx not found"
 exception if ContentType and the target model are stored in 2 distincts db
 {{{
 class ContentType:
     ...
         return
 self.model_class()._base_manager.using(self._state.db).get(**kwargs)
 }}}

 Same thing below if the Comment model and the target model are stored in 2
 distincts db
 {{{
 class CommentDetailsForm:
     ...
         possible_duplicates =
 self.get_comment_model()._default_manager.using(
             self.target_object._state.db
         )....
 }}}

 By using the default manager "objects", the bug is fixed. I confirm that
 it works.

 It's very interesting, you can comment objects stored in a legacy database
 without storing extra data inside.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19068#comment:5>
Django <https://code.djangoproject.com/>
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 https://groups.google.com/groups/opt_out.


Reply via email to