Sphene Community Tools

Community

Copyright © 2007 by Herbert Poul
You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.
Profile for narma

Name narma
Email Address Reveal this emailaddress
Posts7
  • Re: Bug: Issue with two threads with the same title
    Board >> General
    Unfortunately, I'm not able to reproduce this issue.
    I didn't move these Threads, but both ThreadInformation has same type.
  • Re: Test
    Board >> General
    not work, please delete it :)
  • Re: Bug: Issue with two threads with the same title
    Board >> General
    Traceback:
    File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in get_response
      82.                 response = callback(request, *callback_args, **callback_kwargs)
    File "/home/narma/www/sphene/sphboard/views.py" in showThread
      130.     thread.viewed( request.session, request.user )
    File "/home/narma/www/sphene/sphboard/models.py" in viewed
      757.             threadinfo = self.get_threadinformation()
    File "/home/narma/www/sphene/sphboard/models.py" in get_threadinformation
      618.         return ThreadInformation.objects.type_default().get( root_post = self.get_thread() )
    File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in get
      198.         raise self.model.MultipleObjectsReturned("get() returned more than one %s -- it returned %s! Lookup parameters were %s"
    
    Exception Type: MultipleObjectsReturned at /forum/thread/84/
    Exception Value: get() returned more than one ThreadInformation -- it returned 2! Lookup parameters were {'root_post': <Post: dsfgdfg>}
    
    It seems to me that the possible reason is there:
    In 8: Post.objects.filter(subject='dsfgdfg').count()
    Out8: 1L
    
    In 9: ThreadInformation.objects.filter(root_post=p).count()
    Out9: 2L
    

    root_post should be unique for each thread. Am I right?

    --- Last Edited by narma at 2008-06-02 06:06:14 ---
  • Test
    Board >> Sandbox
    test duplicate error bug :)
  • Test
    Board >> General
    test duplicate error bug :)
  • Bug: Issue with two threads with the same title
    Board >> General
    return:
    MultipleObjectsReturned at /forum/thread/84/
    get() returned more than one ThreadInformation -- it returned 2! Lookup parameters were {'root_post': <Post: dsfgdfg>}

  • Bug in Post model
    Board >> General
    When I tried to create a post with attachment an error "Duplicate error" occured.

    This reason was the new django ( svn trunk 7520). It uses _default_manager in Class instead of custom sql queries when looking for existing record in order to decide if we should use 'INDEX' or 'UPDATE'.

    In model 'Post' default object manager was overriden as 'PostManager' who actually filters query_set.

    The solution is to define models.Manager() before 'PostManager', so it will be default for Post as Django uses the first-defined Manager as default.
    see http://www.djangoproject.com/documentation/model-api/#managers for details.


Powered by Sphene Community Tools