示例#1
0
 def to_dict(self, keys_to_show="all"):
     if keys_to_show=="all":
         attributes_to_ignore = ["snaps"]
         ret = dict_from_dir(self, attributes_to_ignore)
     else:
         ret = dict_from_dir(self, keys_to_show=keys_to_show)
     return ret
 def to_dict(self):
     attributes_to_exclude = [
         "states",
         "products",
         "profile"
     ]
     return dict_from_dir(self, attributes_to_exclude)
示例#3
0
 def to_dict(self, hide_keys=[], show_keys="all"):
     hide_keys += [
         "medline_citation", "mesh_terms_no_stars",
         "mesh_terms_no_qualifiers"
     ]
     ret = dict_from_dir(self, hide_keys, show_keys)
     return ret
示例#4
0
 def to_dict(self):
     attributes_to_ignore = [
         "profile_id",
         "products"
     ]
     ret = dict_from_dir(self, attributes_to_ignore)
     return ret
    def to_dict(self, keys_to_show="all"):
        if keys_to_show=="all":
            attributes_to_ignore = [
                "profile",
                "alias_rows",
                "biblio_rows",
                "percentile_snaps",
                "snaps",
                "interactions",
                "snaps_including_interactions"
            ]
            ret = dict_from_dir(self, attributes_to_ignore)
        else:
            ret = dict_from_dir(self, keys_to_show=keys_to_show)

        ret["_tiid"] = self.tiid
        return ret
示例#6
0
    def to_dict(self):
        attributes_to_ignore = [
            "rows",
            "dedup_key"
            ]

        ret = dict_from_dir(self, attributes_to_ignore)
        return ret
示例#7
0
 def to_dict(self):
     # ignore some properties to keep dict small.   
     properties_to_ignore = [
         "exemplar_metric", 
         "products"
         ]
     ret = util.dict_from_dir(self, properties_to_ignore)
     return ret
示例#8
0
 def to_dict(self, hide_keys=[], show_keys="all"):
     hide_keys += [
         "medline_citation",
         "mesh_terms_no_stars",
         "mesh_terms_no_qualifiers"
         ]
     ret = dict_from_dir(self, hide_keys, show_keys)
     return ret
示例#9
0
    def to_dict(self):
        # ignore some properties to keep dict small.   
        properties_to_ignore = ["profile", "product"]
        ret = util.dict_from_dir(self, properties_to_ignore)

        # individual cards can add in more subelements to help with debugging
        ret["url_slug"] = self.profile.url_slug

        return ret
    def to_dict(self):
        attributes_to_ignore = [
            "profile"
        ]
        ret = dict_from_dir(self, attributes_to_ignore)

        # ret = {}
        # for k in dir(self):
        #     if k.startswith("_"):
        #         pass
        #     else:
        #         ret[k] = getattr(self, k)

        return ret
 def to_dict(self):
     attributes_to_ignore = [
         "refset"
     ]
     ret = dict_from_dir(self, attributes_to_ignore)
     return ret
示例#12
0
 def to_dict(self):
     return dict_from_dir(self)
 def to_dict(self):
     ignore = [
         "to_dict",
         "add_event"
     ]
     return dict_from_dir(self, keys_to_ignore=ignore)
示例#14
0
 def to_dict(self):
     ret = dict_from_dir(self, ["config", "snaps"])
     return ret
示例#15
0
 def to_dict(self):
     ret = util.dict_from_dir(self)
     return ret
示例#16
0
 def to_dict(self):
     attributes_to_ignore = [
         "payload"
     ]
     ret = dict_from_dir(self, attributes_to_ignore)
     return ret
示例#17
0
 def to_dict(self):
     return dict_from_dir(self)
示例#18
0
    def to_dict(self):
        attributes_to_ignore = [
            "tweet"
        ]
        ret = dict_from_dir(self, attributes_to_ignore)
        return ret


# example
# [
#   {
#     "name": "Twitter API",
#     "profile_sidebar_fill_color": "DDEEF6",
#     "profile_background_tile": false,
#     "profile_sidebar_border_color": "C0DEED",
#     "profile_image_url": "http://a0.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_normal.png",
#     "location": "San Francisco, CA",
#     "created_at": "Wed May 23 06:01:13 +0000 2007",
#     "follow_request_sent": false,
#     "id_str": "6253282",
#     "profile_link_color": "0084B4",
#     "is_translator": false,
#     "default_profile": true,
#     "favourites_count": 24,
#     "contributors_enabled": true,
#     "url": "http://dev.twitter.com",
#     "profile_image_url_https": "https://si0.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_normal.png",
#     "utc_offset": -28800,
#     "id": 6253282,
#     "profile_use_background_image": true,
#     "listed_count": 10713,
#     "profile_text_color": "333333",
#     "lang": "en",
#     "followers_count": 1198334,
#     "protected": false,
#     "profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme1/bg.png",
#     "geo_enabled": true,
#     "description": "The Real Twitter API. I tweet about API changes, service issues and happily answer questions about Twitter and our API. Don't get an answer? It's on my website.",
#     "profile_background_color": "C0DEED",
#     "verified": true,
#     "notifications": false,
#     "time_zone": "Pacific Time (US & Canada)",
#     "statuses_count": 3331,
#     "status": {
#       "coordinates": null,
#       "created_at": "Fri Aug 24 16:15:49 +0000 2012",
#       "favorited": false,
#       "truncated": false,
#       "id_str": "239033279343382529",
#       "in_reply_to_user_id_str": "134727529",
#       "text": "@gregclermont no, there is not. ^TS",
#       "contributors": null,
#       "retweet_count": 0,
#       "id": 239033279343382529,
#       "in_reply_to_status_id_str": "238933943146131456",
#       "geo": null,
#       "retweeted": false,
#       "in_reply_to_user_id": 134727529,
#       "place": null,
#       "source": "<a href="//sites.google.com/site/yorufukurou/\"" rel="\"nofollow\"">YoruFukurou</a>",
#       "in_reply_to_screen_name": "gregclermont",
#       "in_reply_to_status_id": 238933943146131456
#     },
#     "profile_background_image_url": "http://a0.twimg.com/images/themes/theme1/bg.png",
#     "default_profile_image": false,
#     "friends_count": 31,
#     "screen_name": "twitterapi",
#     "following": true,
#     "show_all_inline_media": false
#   },
#   {
#     "name": "Twitter",
#     "profile_sidebar_fill_color": "F6F6F6",
#     "profile_background_tile": true,
#     "profile_sidebar_border_color": "EEEEEE",
#     "profile_image_url": "http://a0.twimg.com/profile_images/2284174758/v65oai7fxn47qv9nectx_normal.png",
#     "location": "San Francisco, CA",
#     "created_at": "Tue Feb 20 14:35:54 +0000 2007",
#     "follow_request_sent": false,
#     "id_str": "783214",
#     "profile_link_color": "038543",
#     "is_translator": false,
#     "default_profile": false,
#     "favourites_count": 17,
#     "contributors_enabled": true,
#     "url": "http://blog.twitter.com/",
#     "profile_image_url_https": "https://si0.twimg.com/profile_images/2284174758/v65oai7fxn47qv9nectx_normal.png",
#     "utc_offset": -28800,
#     "id": 783214,
#     "profile_banner_url": "https://si0.twimg.com/brand_banners/twitter/1323368512/live",
#     "profile_use_background_image": true,
#     "listed_count": 72534,
#     "profile_text_color": "333333",
#     "lang": "en",
#     "followers_count": 12788713,
#     "protected": false,
#     "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/378245879/Twitter_1544x2000.png",
#     "geo_enabled": true,
#     "description": "Always wondering what's happening. ",
#     "profile_background_color": "ACDED6",
#     "verified": true,
#     "notifications": false,
#     "time_zone": "Pacific Time (US & Canada)",
#     "statuses_count": 1379,
#     "profile_background_image_url": "http://a0.twimg.com/profile_background_images/378245879/Twitter_1544x2000.png",
#     "default_profile_image": false,
#     "friends_count": 1195,
#     "screen_name": "twitter",
#     "following": true,
#     "show_all_inline_media": true
#   }
# ]        
示例#19
0
 def to_dict(self):
     ret = util.dict_from_dir(self)
     return ret