Ejemplo n.º 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
Ejemplo n.º 2
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
Ejemplo n.º 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
            
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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