Changeset 403:cbf8da738b29


Ignore:
Timestamp:
Mar 5, 2012 12:10:32 AM (15 months ago)
Author:
Igor Yanchenko <yanchenko.igor@…>
Branch:
default
Message:

pep8 fix and sql query upercase fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • djangobb_forum/models.py

    r402 r403  
    321321        if forum_settings.REPUTATION_SUPPORT: 
    322322            qs = qs.extra(select={ 
    323                 'reply_total':'Select sum(sign) from djangobb_forum_reputation where to_user_id = djangobb_forum_profile.user_id group by to_user_id', 
    324                 'reply_count_minus':"Select sum(sign) from djangobb_forum_reputation where to_user_id = djangobb_forum_profile.user_id and sign = '-1' group by to_user_id", 
    325                 'reply_count_plus':"Select sum(sign) from djangobb_forum_reputation where to_user_id = djangobb_forum_profile.user_id and sign = '1' group by to_user_id", 
     323                'reply_total': 'SELECT SUM(sign) FROM djangobb_forum_reputation WHERE to_user_id = djangobb_forum_profile.user_id GROUP BY to_user_id', 
     324                'reply_count_minus': "SELECT SUM(sign) FROM djangobb_forum_reputation WHERE to_user_id = djangobb_forum_profile.user_id AND sign = '-1' GROUP BY to_user_id", 
     325                'reply_count_plus': "SELECT SUM(sign) FROM djangobb_forum_reputation WHERE to_user_id = djangobb_forum_profile.user_id AND sign = '1' GROUP BY to_user_id", 
    326326                }) 
    327327        return qs 
Note: See TracChangeset for help on using the changeset viewer.