예제 #1
0
    def dehydrate(self, bundle):
        """ Dehydrate to calc stuff on its way out """

        # Class will always have a created/modified due to default.
        bundle.data["informal_created"] = calculate_informal_time(bundle.data["created"])
        bundle.data["informal_modified"] = calculate_informal_time(bundle.data["modified"])

        if bundle.data.has_key("body"):
            bundle.data["body_snippet"] = derive_snippet(bundle.data["body"])

        # Lookup the user's info
        bundle = get_contributors_info(bundle)

        return bundle
예제 #2
0
파일: api.py 프로젝트: Seaforth/ideaworks
 def dehydrate(self, bundle):
     ''' Dehydrate to calc stuff on its way out '''
     
     # Class will always have a created/modified due to default.
     bundle.data['informal_created'] = calculate_informal_time(bundle.data['created'])
     bundle.data['informal_modified'] = calculate_informal_time(bundle.data['modified'])
     
     if bundle.data.has_key('body'):
         bundle.data['body_snippet'] = derive_snippet(bundle.data['body'])
     
     # Lookup the user's info
     bundle = get_contributors_info(bundle)
     
     return bundle
예제 #3
0
    def dehydrate(self, bundle):
        """ Dehydrate to calc stuff on its way out """

        # Class will always have a created/modified due to default.
        bundle.data['informal_created'] = calculate_informal_time(bundle.data['created'])
        bundle.data['informal_modified'] = calculate_informal_time(bundle.data['modified'])

        if bundle.data.has_key('body'):
            bundle.data['body_snippet'] = derive_snippet(bundle.data['body'])

        # Lookup the user's info
        bundle = get_contributors_info(bundle)
        return bundle
            
예제 #4
0
 def dehydrate(self, bundle):
     """ Dehydrate - data on its way back to requester """
     
     # Class will always have a time_stamp due to default.
     bundle.data['informal_created'] = calculate_informal_time(bundle.data['created'])
     bundle.data['informal_modified'] = calculate_informal_time(bundle.data['modified'])
     
     # Get the useful protective marking elements
     bundle = get_top_level_pm_elements(bundle)
            
     # Lookup the user's info
     bundle = get_contributors_info(bundle)
     
     return bundle
예제 #5
0
    def dehydrate(self, bundle):
        """ Dehydrate - data on its way back to requester """

        # User gets passed through because CustomAuth now passes it even for GET requests
        bundle.data["user_voted"] = get_user_vote_status(bundle)

        # Class will always have a time_stamp due to default.
        bundle.data["informal_created"] = calculate_informal_time(bundle.data["created"])
        bundle.data["informal_modified"] = calculate_informal_time(bundle.data["modified"])

        # Get the useful protective marking elements
        bundle = get_top_level_pm_elements(bundle)

        # Lookup the user's info
        bundle = get_contributors_info(bundle)

        # Produce a truncated (by word), html-tag cleaned version
        if bundle.data.has_key("description"):
            bundle.data["description_snippet"] = derive_snippet(bundle.data["description"])

        return bundle
예제 #6
0
    def dehydrate(self, bundle):
        """ Dehydrate - data on its way back to requester """

        # User gets passed through because CustomAuth now passes it even for GET requests
        bundle.data['user_voted'] = get_user_vote_status(bundle)

        # Class will always have a time_stamp due to default.
        bundle.data['informal_created'] = calculate_informal_time(
            bundle.data['created'])
        bundle.data['informal_modified'] = calculate_informal_time(
            bundle.data['modified'])

        # Get the useful protective marking elements
        bundle = get_top_level_pm_elements(bundle)

        # Lookup the user's info
        bundle = get_contributors_info(bundle)

        # Produce a truncated (by word), html-tag cleaned version
        if bundle.data.has_key('description'):
            bundle.data['description_snippet'] = derive_snippet(
                bundle.data['description'])

        return bundle
예제 #7
0
    def dehydrate(self, bundle):

        # Lookup the user's info
        bundle = get_contributors_info(bundle)
        return bundle
예제 #8
0
    def dehydrate(self, bundle):

        # Lookup the user's info
        bundle = get_contributors_info(bundle)
        return bundle