def ready(self):
from nodeshot.core.nodes.base import ExtensibleNodeSerializer<EOL>from .models import Vote<EOL>from .serializers import (CommentRelationSerializer,<EOL>ParticipationSerializer)<EOL>ExtensibleNodeSerializer.add_relationship(<EOL>'<STR_LIT>',<EOL>serializer=CommentRelationSerializer,<EOL>many=True,<EOL>queryset=lambda obj, request: obj.comment_set.all()<EOL>)<EOL>ExtensibleNodeSerializer.add_relationship(<EOL>'<STR_LIT>',<EOL>serializer=ParticipationSerializer,<EOL>queryset=lambda obj, request: obj.noderatingcount<EOL>)<EOL>ExtensibleNodeSerializer.add_relationship(<EOL>'<STR_LIT>',<EOL>view_name='<STR_LIT>',<EOL>lookup_field='<STR_LIT>'<EOL>)<EOL>ExtensibleNodeSerializer.add_relationship(<EOL>'<STR_LIT>',<EOL>view_name='<STR_LIT>',<EOL>lookup_field='<STR_LIT>'<EOL>)<EOL>ExtensibleNodeSerializer.add_relationship(<EOL>'<STR_LIT>',<EOL>view_name='<STR_LIT>',<EOL>lookup_field='<STR_LIT>'<EOL>)<EOL>def voted(obj, request):<EOL><INDENT>"""<STR_LIT>"""<EOL>if request.user.is_authenticated():<EOL><INDENT>v = Vote.objects.filter(node_id=obj.id, user_id=request.user.id)<EOL>if len(v) > <NUM_LIT:0>:<EOL><INDENT>return v[<NUM_LIT:0>].vote<EOL><DEDENT><DEDENT>return False<EOL><DEDENT>ExtensibleNodeSerializer.add_relationship(<EOL>'<STR_LIT>',<EOL>function=voted<EOL>)<EOL>ExtensibleNodeSerializer.add_relationship(<EOL>'<STR_LIT>',<EOL>function=lambda obj, request: obj.voting_allowed<EOL>)<EOL>ExtensibleNodeSerializer.add_relationship(<EOL>'<STR_LIT>',<EOL>function=lambda obj, request: obj.rating_allowed<EOL>)<EOL>ExtensibleNodeSerializer.add_relationship(<EOL>'<STR_LIT>',<EOL>function=lambda obj, request: obj.comments_allowed<EOL>)<EOL>
Add user info to ExtensibleNodeSerializer