Re: [Django] #19068: comments in a multiple database context

2012-10-12 Thread Django
#19068: comments in a multiple database context
--+--
 Reporter:  esimorre  |Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  contrib.comments  |  Version:
 Severity:  Normal|   Resolution:  duplicate
 Keywords:| Triage Stage:  Unreviewed
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--
Changes (by ptone):

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


Comment:

 solve #15610 / #16039 and this is solved

 comments is just a specific case of the general problem

-- 
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 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.




Re: [Django] #19068: comments in a multiple database context

2012-10-04 Thread Django
#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):

 not exactly because the target component is contrib.comment; but both
 should be analysed together.

-- 
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 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.




Re: [Django] #19068: comments in a multiple database context

2012-10-04 Thread Django
#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 ptone):

 Is this not really a duplicate of #15610?

-- 
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 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.




Re: [Django] #19068: comments in a multiple database context

2012-10-04 Thread Django
#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: 
Django 
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.




Re: [Django] #19068: comments in a multiple database context

2012-10-04 Thread Django
#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
--+--
Changes (by esimorre):

 * status:  closed => reopened
 * resolution:  needsinfo =>


-- 
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 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.




Re: [Django] #19068: comments in a multiple database context

2012-10-03 Thread Django
#19068: comments in a multiple database context
--+--
 Reporter:  esimorre  |Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  contrib.comments  |  Version:
 Severity:  Normal|   Resolution:  needsinfo
 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):

 my contenttypes' table is in sqlitedb , self.model_class() is stored in
 oracledb

 this expression is incorrect because "self" is a ContentType object
 {{{self.model_class()._base_manager.using(self._state.db).get(**kwargs)}}}

 The commented object (oracledb) is searched in the contenttype sqlitedb.
 If "objects" is used, the db is right.

 I have no trace (the project is deployed in an intranet), but the error
 message is: table xxx not found.

-- 
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 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.




Re: [Django] #19068: comments in a multiple database context

2012-10-03 Thread Django
#19068: comments in a multiple database context
--+--
 Reporter:  esimorre  |Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  contrib.comments  |  Version:
 Severity:  Normal|   Resolution:  needsinfo
 Keywords:| Triage Stage:  Unreviewed
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--
Changes (by melinath):

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


Comment:

 I wouldn't be surprised if contrib.comments had issues related to multiple
 databases. But neither of the changes suggested would improve multiple
 database support. _default_manager, for example, is usually the same as
 .objects, unless a new default manager is being used (in which case that
 should probably be used instead of .objects).

 It would be great if you could gather more information and reopen this
 ticket. What's the exact problem you're seeing? Are you getting any kind
 of traceback?

-- 
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 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.




Re: [Django] #19068: comments in a multiple database context

2012-10-03 Thread Django
#19068: comments in a multiple database context
--+--
 Reporter:  esimorre  |Owner:  nobody
 Type:  Bug   |   Status:  new
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
--+--
Changes (by esimorre):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 I would suggest to replace '''_base_manager.using(self._state.db)''' by
 '''objects''' below

  * contenttypes.models.py:
 {{{
 def get_object_for_this_type(self, **kwargs):
 """
 Returns an object of this type for the keyword arguments given.
 Basically, this is a proxy around this object_type's get_object()
 model
 method. The ObjectNotExist exception, if thrown, will not be
 caught,
 so code that calls this method should catch it.
 """
 return
 self.model_class()._base_manager.using(self._state.db).get(**kwargs)
 }}}

 idem for '''_default_manager.using(self.target_object._state.db)''' below

  * comments.forms.py:
 {{{
 def check_for_duplicate_comment(self, new):
 """
 Check that a submitted comment isn't a duplicate. This might be
 caused
 by someone posting a comment twice. If it is a dup, silently
 return the *previous* comment.
 """
 possible_duplicates =
 self.get_comment_model()._default_manager.using(
 self.target_object._state.db
 ).filter(
 content_type = new.content_type,
 object_pk = new.object_pk,
 user_name = new.user_name,
 user_email = new.user_email,
 user_url = new.user_url,
 )
 for old in possible_duplicates:
 if old.submit_date.date() == new.submit_date.date() and
 old.comment == new.comment:
 return old

 return new
 }}}

-- 
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 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.




[Django] #19068: comments in a multiple database context

2012-10-03 Thread Django
#19068: comments in a multiple database context
--+
 Reporter:  esimorre  |  Owner:  nobody
 Type:  Bug   | Status:  new
Component:  contrib.comments  |Version:
 Severity:  Normal|   Keywords:
 Triage Stage:  Unreviewed|  Has patch:  0
Easy pickings:  0 |  UI/UX:  0
--+
 a legacy database, another database to store
 (django.contrib.admin.)comments: it does not work.

-- 
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 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.