Review: Needs Fixing

Hello,

get_vote_summary is not necessary anymore. Client-side, using vote_ids, you 
have the number of votes (length of the list); is_vote_liked can be computed by 
verifying that uid is in the list. It removes unnecessary calls and queries.

In vote_toggle: no need to do voters_id = vote_pool.search(cr, uid, [('msg_id', 
'=', message.id), ('user_id', '=', uid)], context=context). In the vote_ids 
alreaydy give you the votes; just check that uid is in the list of votes.

Best regards,

Thibault.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-openchatter-mail_vote-part-4-atp/+merge/118915
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-openchatter-mail_vote-part-4-atp.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to